On Sun, Sep 21, 2008 at 9:46 PM, Rafael Beccar Barca
<[EMAIL PROTECTED]> wrote:
> On Sun, Sep 21, 2008 at 9:23 PM, Malcolm Tredinnick
> <[EMAIL PROTECTED]> wrote:
>>
>>
>> On Sun, 2008-09-21 at 17:36 -0300, Rafael Beccar Barca wrote:
>>> Hi,
>>>
>>> I didn't find documentation for _get_next_or_previous_by_FIELD and
>>> _get_next_or_previous_in_order
>>
>> The fact that they start with underscores and aren't documented in the
>> Model API is a big that they are internal methods, not intended to be
>> used by any user-level code.
>>
>>> What parameters should I pass when calling them from shell ?
>>>
>>> How should I use them on my templates ?
>>
>> You shouldn't use them directly. What is the problem you are actually
>> trying to solve?
>
> I was trying to implement previous and next buttons and I found this tutorial:
>
> http://www.webmonkey.com/tutorial/Install_Django_and_Build_Your_First_App#Tweak_the_links_and_tags
>
> where teach a very interesting way of implement them for date fields
> but I need to use them for a class that doesn't have any date time
> fields but is ordered by an integer field.
>
> Then, I used ipython to check what methods were available for the
> object and got curious about _get_next_or_previous_by_FIELD and
> _get_next_or_previous_in_order
>
> But I think I would change my question to a clearer one: How can I
> easily implement next and previous buttons in my template for a class
> that does not have any date fields?
>
> I'm not expecting a full explanation, just some tips so I can start
> investigating myself.

Well, I just solved the problem by writing the logic on the view and
passing "next" and "previous" variables in the context.

However, I still wonder if get_next_in_order and get_previous_in_order
(defined in db/models/base.py) are django built-ins for doing this. I
tried to use them but I just don't get how they work. But I will let
that for further investigation somewhere in the future.

Thanks anyway.

Regards,
Rafael

>
> Regards,
> Rafael
>
>>
>> Regards,
>> Malcolm
>>
>>
>>
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to