From 778d698a413a7f66185ea44349f49d83bf594c6f Mon Sep 17 00:00:00 2001 From: sanj Date: Sun, 14 Mar 2010 06:47:29 +0530 Subject: [PATCH] erang admin --- itf/erang/models.py | 31 ++++++++++++++++++++++++++++++- itf/itfcore/models.py | 2 +- requirements.txt | 2 ++ 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/itf/erang/models.py b/itf/erang/models.py index b9c6098..51bbcfc 100644 --- a/itf/erang/models.py +++ b/itf/erang/models.py @@ -1,22 +1,51 @@ from django.db import models +import datetime class Issue(models.Model): name = models.CharField(max_length=255) date = models.DateField() + published = models.BooleanField(default=False) + notes = models.TextField(blank=True) + def __unicode__(self): return self.name class Article(models.Model): author = models.ForeignKey("Contributor", blank=True, null=True) title = models.CharField(max_length=255) - text = models.TextField() + notes = models.TextField(blank=True) issue = models.ForeignKey(Issue) + def __unicode__(self): return self.title + " - " + self.author class Contributor(models.Model): name = models.CharField(max_length=255) email = models.EmailField(blank=True, null=True) + def __unicode__(self): return self.name + ": " + self.email +class Document(models.Model): + file = models.FileField(upload_to='erang/documents/') + title = models.CharField(max_length=500) + issue = models.ForeignKey(Issue) + notes = models.TextField(blank=True) + contributor = models.ForeignKey(Contributor) + doc_txt = models.TextField(blank=True) + date_added = models.DateTimeField(default=datetime.datetime.now()) + + def __unicode__(self): + return self.title + +class Image(models.Model): + file = models.FileField(upload_to='erang/images/') + title = models.CharField(max_length=255) + issue = models.ForeignKey(Issue) + notes = models.TextField(blank=True) + date_added = models.DateTimeField(default=datetime.datetime.now()) + + def __unicode__(self): + return self.title + + diff --git a/itf/itfcore/models.py b/itf/itfcore/models.py index e5e5001..e29b227 100644 --- a/itf/itfcore/models.py +++ b/itf/itfcore/models.py @@ -114,7 +114,7 @@ class Nickname(models.Model): class Profile(models.Model): user = models.ForeignKey(User, blank=True, unique=True, null=True) phone = models.CharField(max_length=255, blank=True) - email = models.CharField(max_length=255, blank=True) + email = models.CharField(max_length=255, blank=True, db_index=True) groups = models.ManyToManyField('TheatreGroup', through='ProfileGroup', blank=True, symmetrical=False) occupation = MultiSelectField(max_length=1000, choices=OCCUPATION_TYPES, verbose_name="Occupation Type", blank=True) connections = models.ManyToManyField('Profile', through='ProfileProfile', blank=True, symmetrical=False) diff --git a/requirements.txt b/requirements.txt index 1c57c9f..9d3ebab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ -e svn+http://code.djangoproject.com/svn/django/branches/releases/1.1.X/#egg=django -e bzr+http://code.0xdb.org/python-oxdjango/#egg=python-oxdjango -e svn+http://django-multilingual.googlecode.com/svn/trunk/#egg=multilingual +-e bzr+http://firefogg.org/dev/python-firefogg/#egg=python-firefogg +-e bzr+http://firefogg.org/dev/django_firefogg/#egg=django_firefogg sorl-thumbnail django-extensions django-debug-toolbar