Changeset 3683
- Timestamp:
- 08/30/06 22:16:08 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/tests/modeltests/get_latest/models.py
r3661 r3683 4 4 Models can have a ``get_latest_by`` attribute, which should be set to the name 5 5 of a DateField or DateTimeField. If ``get_latest_by`` exists, the model's 6 m odule will get a ``get_latest()`` function, which will return the latest7 object in the database according to that field. "Latest" means "having the 8 date farthestinto the future."6 manager will get a ``latest()`` method, which will return the latest object in 7 the database according to that field. "Latest" means "having the date farthest 8 into the future." 9 9 """ 10 10 … … 31 31 32 32 __test__ = {'API_TESTS':""" 33 # Because no Articles exist yet, get_latest() raises ArticleDoesNotExist.33 # Because no Articles exist yet, latest() raises ArticleDoesNotExist. 34 34 >>> Article.objects.latest() 35 35 Traceback (most recent call last):
