2008-07-10 12:12:41 +00:00
|
|
|
from django.db import models
|
2012-08-12 10:32:08 +00:00
|
|
|
from django.utils.encoding import python_2_unicode_compatible
|
2008-07-10 12:12:41 +00:00
|
|
|
|
2011-10-13 18:51:33 +00:00
|
|
|
|
2012-08-12 10:32:08 +00:00
|
|
|
@python_2_unicode_compatible
|
2008-07-10 12:12:41 +00:00
|
|
|
class Article(models.Model):
|
|
|
|
headline = models.CharField(max_length=100, default='Default headline')
|
|
|
|
pub_date = models.DateTimeField()
|
|
|
|
|
2012-08-12 10:32:08 +00:00
|
|
|
def __str__(self):
|
2008-07-10 12:12:41 +00:00
|
|
|
return self.headline
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ('-pub_date', 'headline')
|