From 8f20a71564aa2da1fe47a33ac6656ab9581dbc5c Mon Sep 17 00:00:00 2001 From: sanj Date: Fri, 19 Mar 2010 15:00:42 +0530 Subject: [PATCH] added Document Categories --- itf/erang/models.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/itf/erang/models.py b/itf/erang/models.py index 7c2f482..751d0e1 100644 --- a/itf/erang/models.py +++ b/itf/erang/models.py @@ -30,15 +30,25 @@ class Contributor(models.Model): def __unicode__(self): return self.name + ": " + self.email +DOC_CATEGORIES = ( + ('main', 'Main Article'), + ('secondary', 'Secondary Article'), + ('feedback', 'Feedback'), + ('announce', 'Announcements & Reviews'), + ('reference', 'Reference'), + ('other', 'Other'), +) + class Document(models.Model): file = models.FileField(upload_to='erang/documents/') title = models.CharField(max_length=500) issue = models.ForeignKey(Issue) + category = models.CharField(max_length=255, choices=DOC_CATEGORIES, blank=True) notes = models.TextField(blank=True) contributor = models.ForeignKey(Contributor, blank=True, null=True) doc_txt = models.TextField(blank=True) date_added = models.DateTimeField(default=datetime.datetime.now(), editable=False) - + def txtPath(self): path = self.file.path return path + ".txt"