PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/regressiontests/introspection/models.py

https://code.google.com/p/mango-py/
Python | 21 lines | 16 code | 5 blank | 0 comment | 0 complexity | 91f03753326e7a691c1d95c68704d3aa MD5 | raw file
 1from django.db import models
 2
 3class Reporter(models.Model):
 4    first_name = models.CharField(max_length=30)
 5    last_name = models.CharField(max_length=30)
 6    email = models.EmailField()
 7    facebook_user_id = models.BigIntegerField()
 8
 9    def __unicode__(self):
10        return u"%s %s" % (self.first_name, self.last_name)
11
12class Article(models.Model):
13    headline = models.CharField(max_length=100)
14    pub_date = models.DateField()
15    reporter = models.ForeignKey(Reporter)
16
17    def __unicode__(self):
18        return self.headline
19
20    class Meta:
21        ordering = ('headline',)