On 10/24/06, shelbybark <[EMAIL PROTECTED]> wrote: > While getting familiar with Jeff Croft's Lost-Theories code, I ran > across a variable called get_next_by_x (or get_previous_by_x). I have > not been able to find any documentation for this, but in testing it out > it appears to be only usable by date-based item from a model. I was > trying to figure out a way to use it with a unique ID from a Flickr > import of photos, but have not found a way to get it to use the photo's > ID number. Does anyone know any more about this variable?
It's a method on each object of that model class, created whenever there's a DateField or DateTimeField; for example, if you had a blog with an Entry model, and it had a DateTimeField called 'pub_date', each Entry would have a 'get_next_by_pub_date()' and 'get_previous_by_pub_date()' (and would raise a DoesNotExist exception if there wasn't a next or previous Entry). Documentation for it is here, but really that's about all there is to it, aside from the fact that it can take keyword arguments for filtering: http://www.djangoproject.com/documentation/db_api/#get-next-by-foo-kwargs-and-get-previous-by-foo-kwargs -- "May the forces of evil become confused on the way to your house." -- George Carlin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---

