Re: Unexpected result from making single object query

2011-02-22 Thread Daniel Roseman
On Tuesday, February 22, 2011 9:35:18 PM UTC, mm wrote: > > the next field in the Entry table contain the name of the next entry > the prev field in the Entry table contain the name of the previous > entry. > > current_entry = Entry.objects.get(id=10) > > next_entry = Entry.objects.get(next=cur

Re: Unexpected result from making single object query

2011-02-22 Thread delegbede
ers@googlegroups.com Date: Tue, 22 Feb 2011 12:30:27 To: Django users 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.objec

Re: Unexpected result from making single object query

2011-02-22 Thread mm
I see where my problem is. I should use the name field instead: next_entry = Entry.objects.get(name=current_entry.next) prev_entry = Entry.objects.get(name=current_entry.prev) thanks On Feb 22, 3:35 pm, mm wrote: > the next field in the Entry table contain the name of the next entry > the prev

Re: Unexpected result from making single object query

2011-02-22 Thread mm
the next field in the Entry table contain the name of the next entry the prev field in the Entry table contain the name of the previous entry. current_entry = Entry.objects.get(id=10) next_entry = Entry.objects.get(next=current_entry.next) prev_entry = Entry.objects.get(prev=current_entry.prev)

Re: Unexpected result from making single object query

2011-02-22 Thread Daniel Roseman
On Tuesday, February 22, 2011 8:30:27 PM UTC, mm wrote: > > 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.

Re: Unexpected result from making single object query

2011-02-22 Thread Shawn Milochik
What do the 'next' and 'prev' methods of your Entry model do? Shawn -- 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+

Unexpected result from making single object query

2011-02-22 Thread mm
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