2006-05-02 01:31:56 +00:00
|
|
|
from django.db import models
|
|
|
|
|
2011-10-13 18:04:12 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class Article(models.Model):
|
2007-08-05 05:14:46 +00:00
|
|
|
headline = models.CharField(max_length=100)
|
2006-05-02 01:31:56 +00:00
|
|
|
pub_date = models.DateField()
|
|
|
|
expire_date = models.DateField()
|
2013-01-20 06:53:45 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class Meta:
|
|
|
|
get_latest_by = 'pub_date'
|
|
|
|
|
2013-01-12 08:37:19 +00:00
|
|
|
|
2006-05-02 01:31:56 +00:00
|
|
|
class Person(models.Model):
|
2007-08-05 05:14:46 +00:00
|
|
|
name = models.CharField(max_length=30)
|
2006-05-02 01:31:56 +00:00
|
|
|
birthday = models.DateField()
|
|
|
|
# Note that this model doesn't have "get_latest_by" set.
|