changeset 307 | c6bca38c1cbf |
306:5ff1fc726848 | 307:c6bca38c1cbf |
---|---|
1 from django.db import models |
|
2 |
|
3 class Article(models.Model): |
|
4 headline = models.CharField(max_length=100, default='Default headline') |
|
5 pub_date = models.DateTimeField() |
|
6 |
|
7 def __unicode__(self): |
|
8 return self.headline |
|
9 |
|
10 class Meta: |
|
11 ordering = ('-pub_date', 'headline') |
|
12 |