Code

Opened 8 years ago

Closed 8 years ago

#2595 closed defect (worksforme)

get_next_by_FIELD returns itself if it is the last item, under postgres

Reported by: matt@… Owned by: adrian
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Sometime in the last few days get_next_by_FIELD seems to have broken under Postgresql. Calling get_next_by_published, where published is a DateTimeField(auto_now_add=True), on the latest item returns that same item again. e.g.

>>> x = Post.objects.all()
>>> x
... [<Post: #3 (2006-08-23)>, <Post: #2 (2006-08-20)>, <Post: #1 (2006-08-18)>]
>>> x[0]
... <Post: #3 (2006-08-23)>
>>> x[0].get_next_by_published()
... <Post: #3 (2006-08-23)>

Works fine under MySQL (passes all tests, and I don't see the problem). Unfortunately I don't have enough postgres access to run the tests there.

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by matt@…

  • Resolution set to worksforme
  • Status changed from new to closed

Ok, problem seems to have gone away...

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.