From: Seth Woodworth Date: Wed, 20 Mar 2013 02:39:06 +0000 (-0400) Subject: adding Note.year for Academic year, not tested, status checkin, writing functionality... X-Git-Tag: release-20150131~483^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=093fe46221fca27eced9be24836458f12151dc46;p=oweals%2Fkarmaworld.git adding Note.year for Academic year, not tested, status checkin, writing functionality to test now --- diff --git a/karmaworld/apps/notes/forms.py b/karmaworld/apps/notes/forms.py index 17ba990..1207b02 100644 --- a/karmaworld/apps/notes/forms.py +++ b/karmaworld/apps/notes/forms.py @@ -3,10 +3,14 @@ # Copyright (C) 2012 FinalsClub Foundation from django.forms import ModelForm +from django.forms import TextInput from karmaworld.apps.notes.models import Note class NoteForm(ModelForm): class Meta: model = Note - fields = ('name', 'tags', 'desc',) + fields = ('name', 'tags', 'year',) + widgets = { + 'name': TextInput() + } diff --git a/karmaworld/apps/notes/models.py b/karmaworld/apps/notes/models.py index 3861713..5b34fdc 100644 --- a/karmaworld/apps/notes/models.py +++ b/karmaworld/apps/notes/models.py @@ -41,6 +41,8 @@ class Note(models.Model): name = models.CharField(max_length=255, blank=True, null=True) slug = models.SlugField(max_length=255, null=True) + year = models.IntegerField(blank=True, null=True, + default=datetime.datetime.utcnow().year) desc = models.TextField(max_length=511, blank=True, null=True) uploaded_at = models.DateTimeField(null=True, default=datetime.datetime.utcnow)