erang admin

This commit is contained in:
sanj 2010-03-14 06:47:29 +05:30
parent da88171569
commit 778d698a41
3 changed files with 33 additions and 2 deletions

View File

@ -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

View File

@ -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)

View File

@ -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