get_next_by_pub_date/get_previous_by_pub_date model methods only see 1 item for each day.
|Reported by:||mattycakes@…||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The model.get_next_by_pub_date() and model.get_previous_by_pub_date() methods appear to only see one item for each day.
For example, I have a blog.posts model in which pub_date is a DateTimeField. If there are multiple posts in one day, the above methods will only see the first post for each day, and then skip to the next day. This is clearly wrong behaviour; the method should retrieve the next item by date whether it was created the same day or not.
item1.pub_date = 2005/01/01 12:00 item2.pub_date = 2005/01/02 8:00 item3.pub_date = 2005/01/02 9:00 item1.get_next… = item2 item2.get_next… = None item3.get_prev… = item1
Change History (5)
comment:2 Changed 11 years ago by adrian
- Resolution set to invalid
- Status changed from new to closed
comment:3 Changed 11 years ago by mattycakes@…
- Resolution invalid deleted
- Status changed from closed to reopened