On Feb 7, 2010, at 8:54 PM, eaman wrote:



On Feb 7, 3:24 am, Eric Abrahamsen <gir...@gmail.com> wrote:
Yup, if you have non-null date/datetime fields on your model, each
model will automatically get "get_next_by_FOO" and
"get_previous_by_FOO" methods, where FOO is the name of the datetime
Well I guess the 'Lazy' optiond is to add a date field to my model and
get the free pagination. Or code my own view, of course.

The lazy option would probably be to add get_next() and get_previous() methods to your model, that return an instance based on whatever definition of "next" and "previous" works for you. You might consider some kind of timestamp field for your model, though – you'd be surprised how often that comes in handy…


Thanks.
/eaman
[CUT]

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-us...@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-us...@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