Re: next page in this category

2007-08-14 Thread James Bennett
On 8/14/07, James Tauber <[EMAIL PROTECTED]> wrote: > Okay, this is the solution I came up with: > > http://dpaste.com/16869/ I've done some similar things to account for a get_next/get_previous on a model where some objects aren't meant to be publicly visible, and remembered a little-known but i

Re: next page in this category

2007-08-14 Thread James Tauber
Actually, one problem with this is the first / last page will get a 'list index out of range'. I notice _get_next_or_previous_by_FIELD just catches an IndexError so I guess I'll do the same. James On 14/08/2007, at 6:55 PM, James Tauber wrote: > > > Okay, this is the solution I came up wit

Re: next page in this category

2007-08-14 Thread James Tauber
Okay, this is the solution I came up with: http://dpaste.com/16869/ On 14/08/2007, at 12:31 AM, James Tauber wrote: > > > Imagine you have a Page model with a creation_time field and a many- > to-many field of Categories. > > Clearly you can navigate through each page in creation order one b

next page in this category

2007-08-13 Thread James Tauber
Imagine you have a Page model with a creation_time field and a many- to-many field of Categories. Clearly you can navigate through each page in creation order one by one with get_next_by_creation_time (which is quite awesome, really). But how might one do the same per category? i.e. for each