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