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 <haibho...@gmail.com> 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=current_entry.next)
> prev_entry = Entry.objects.get(prev=current_entry.prev)
>
> For business reason, we used the name of the entry instead of the ID.
>
> On Feb 22, 2:35 pm, Shawn Milochik <sh...@milochik.com> wrote:
>
> > 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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to