PageRenderTime 29ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/regressiontests/syndication/models.py

https://code.google.com/p/mango-py/
Python | 23 lines | 15 code | 8 blank | 0 comment | 0 complexity | 797c61f5a10738a2706b6778c208e0a6 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. from django.db import models
  2. class Entry(models.Model):
  3. title = models.CharField(max_length=200)
  4. date = models.DateTimeField()
  5. class Meta:
  6. ordering = ('date',)
  7. def __unicode__(self):
  8. return self.title
  9. def get_absolute_url(self):
  10. return "/blog/%s/" % self.pk
  11. class Article(models.Model):
  12. title = models.CharField(max_length=200)
  13. entry = models.ForeignKey(Entry)
  14. def __unicode__(self):
  15. return self.title