2009-12-19 14:27:26 +00:00
|
|
|
from django.db import models
|
2012-08-12 10:32:08 +00:00
|
|
|
from django.utils.encoding import python_2_unicode_compatible
|
2009-12-19 14:27:26 +00:00
|
|
|
|
2011-10-13 18:04:12 +00:00
|
|
|
|
2012-08-12 10:32:08 +00:00
|
|
|
@python_2_unicode_compatible
|
2009-12-19 14:27:26 +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):
|
2009-12-19 14:27:26 +00:00
|
|
|
return self.headline
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
app_label = 'fixtures_model_package'
|
|
|
|
ordering = ('-pub_date', 'headline')
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2011-11-27 13:00:56 +00:00
|
|
|
class Book(models.Model):
|
|
|
|
name = models.CharField(max_length=100)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
ordering = ('name',)
|