PageRenderTime 67ms CodeModel.GetById 64ms app.highlight 1ms RepoModel.GetById 1ms 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
 1from django.db import models
 2
 3class Entry(models.Model):
 4    title = models.CharField(max_length=200)
 5    date = models.DateTimeField()
 6
 7    class Meta:
 8        ordering = ('date',)
 9
10    def __unicode__(self):
11        return self.title
12
13    def get_absolute_url(self):
14        return "/blog/%s/" % self.pk
15
16
17class Article(models.Model):
18    title = models.CharField(max_length=200)
19    entry = models.ForeignKey(Entry)
20
21    def __unicode__(self):
22        return self.title
23