From 093fe46221fca27eced9be24836458f12151dc46 Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Tue, 19 Mar 2013 22:39:06 -0400 Subject: [PATCH] adding Note.year for Academic year, not tested, status checkin, writing functionality to test now --- karmaworld/apps/notes/forms.py | 6 +++++- karmaworld/apps/notes/models.py | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) 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) -- 2.25.1