adding Note.year for Academic year, not tested, status checkin, writing functionality...
authorSeth Woodworth <seth@sethish.com>
Wed, 20 Mar 2013 02:39:06 +0000 (22:39 -0400)
committerSeth Woodworth <seth@sethish.com>
Wed, 20 Mar 2013 02:39:06 +0000 (22:39 -0400)
karmaworld/apps/notes/forms.py
karmaworld/apps/notes/models.py

index 17ba9909d4ce0cf52c6f0825665ecbc2c2b8c43c..1207b02baf4cfb3ba5874d2cfdb018adaa19eef4 100644 (file)
@@ -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()
+        }
index 386171336e9b14f828b006f263608b8efd906721..5b34fdc4a11ea6dc13b02fcf5ea4fe088afda03e 100644 (file)
@@ -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)