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