PageRenderTime 1067ms CodeModel.GetById 19ms RepoModel.GetById 86ms 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
Possible License(s): BSD-3-Clause
  1. from django.db import models
  2. class Reporter(models.Model):
  3. first_name = models.CharField(max_length=30)
  4. last_name = models.CharField(max_length=30)
  5. email = models.EmailField()
  6. facebook_user_id = models.BigIntegerField()
  7. def __unicode__(self):
  8. return u"%s %s" % (self.first_name, self.last_name)
  9. class Article(models.Model):
  10. headline = models.CharField(max_length=100)
  11. pub_date = models.DateField()
  12. reporter = models.ForeignKey(Reporter)
  13. def __unicode__(self):
  14. return self.headline
  15. class Meta:
  16. ordering = ('headline',)