First, confirm the relationship between those variables. current_entry = Entry.objects.get(id=10) next_entry = Entry.objects.get(current_entry.next) prev_entry = Entry.objects.get(current_entry.prev) By my estimation,next_entry should return Entry object with I'd of 11 while prev_entry returns I'd of 9. That you're not getting any error doesn't necessarily mean you're correct. You might have to do a dir(Entry.objects) to get all possible methods. Regards. Sent from my BlackBerry wireless device from MTN
-----Original Message----- From: mm <haibho...@gmail.com> Sender: django-users@googlegroups.com Date: Tue, 22 Feb 2011 12:30:27 To: Django users<django-users@googlegroups.com> Reply-To: django-users@googlegroups.com Subject: Unexpected result from making single object query I am not sure what I am doing wrong but there is my code: current_entry = Entry.objects.get(id=10) next_entry = Entry.objects.get(current_entry.next) prev_entry = Entry.objects.get(current_entry.prev) where current_entry.next and current_entry.prev columns contained the name of the previous and next entry. No matter what I do, the return value of the next_entry and prev_entry are always the same value of current_entry. I run this in interactive shell environment also but I get the same result. Please help. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.