it/itf/erang/models.py
2010-03-03 19:58:00 +05:30

23 lines
641 B
Python

from django.db import models
class Issue(models.Model):
name = models.CharField(max_length=255)
date = models.DateField()
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()
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