Google Groups Home
Help | Sign in
how to create multiple pagination objects
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
amarsibia  
View profile
 More options Mar 25, 10:55 pm
From: amarsibia <amarsi...@googlemail.com>
Date: Tue, 25 Mar 2008 19:55:28 -0700 (PDT)
Local: Tues, Mar 25 2008 10:55 pm
Subject: how to create multiple pagination objects
i want to make 2 pagination objects 1 for blogs and 1 for links (these
user blog links) i have read that it is now possible since TG 1.0.2
but have no idea how to implement it. currently i am doing

    @expose(template='kid:tblog.BlogEntryController.templates.list')
    @paginate('records', limit=10)
    @paginate('users', limit=1)
    def list(self, **kw):
        users = User.select(orderBy=User.q.display_name)
        """List records in model"""
        records = BlogEntry.select()
        return dict(records = records, modelname=self.modelname,
users=users)

it correctly limits the select() items, but it wont show the paginate
links, im using the following code to display my paginate:

                <span py:for="page in tg.paginate.pages">
                        <a py:if="page != tg.paginate.current_page" href="$
{tg.paginate.get_href(page)}">${page}</a>
                <span py:if="page == tg.paginate.current_page">${page}</span>
                </span>

However it is the same for both objects, i dont know how to declare it
to use a different paginate object. any help would be brilliant.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Demetrescu  
View profile
 More options Mar 26, 6:51 am
From: "Roger Demetrescu" <roger.demetre...@gmail.com>
Date: Wed, 26 Mar 2008 07:51:20 -0300
Local: Wed, Mar 26 2008 6:51 am
Subject: Re: [TurboGears] how to create multiple pagination objects

Instead of tg.paginate.xxxxx, try using  tg.paginates['users'].xxxxx and
tg.paginates['records'].xxxxx inside your template.

tg.paginates is a dictionary containing all paginates objects.
tg.paginate points to the last paginate object processed by paginate
decorator.  (too many "paginate" sentences in this sentence, I know
:))

Cheers,

Roger


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
amarsibia  
View profile
 More options Mar 26, 2:36 pm
From: amarsibia <amarsi...@googlemail.com>
Date: Wed, 26 Mar 2008 11:36:14 -0700 (PDT)
Local: Wed, Mar 26 2008 2:36 pm
Subject: Re: how to create multiple pagination objects
Thank you so much i just couldn't find that syntax anywhere

On Mar 26, 10:51 am, "Roger Demetrescu" <roger.demetre...@gmail.com>
wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger Demetrescu  
View profile
 More options Mar 26, 2:49 pm
From: "Roger Demetrescu" <roger.demetre...@gmail.com>
Date: Wed, 26 Mar 2008 15:49:43 -0300
Local: Wed, Mar 26 2008 2:49 pm
Subject: Re: [TurboGears] Re: how to create multiple pagination objects
On 3/26/08, amarsibia <amarsi...@googlemail.com> wrote:

> Thank you so much i just couldn't find that syntax anywhere

Yeaph, I know...
This is one of new features paginate decorator has which isn't
documented already..  :(

For now, try searching for 'pagina'  in changelog to have an idea of
what have been changed recently..

http://trac.turbogears.org/wiki/ChangeLog

[]s
Roger


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Florent Aide  
View profile
 More options Mar 26, 5:51 pm
From: "Florent Aide" <florent.a...@gmail.com>
Date: Wed, 26 Mar 2008 22:51:06 +0100
Local: Wed, Mar 26 2008 5:51 pm
Subject: Re: [TurboGears] Re: how to create multiple pagination objects
On Wed, Mar 26, 2008 at 7:49 PM, Roger Demetrescu

<roger.demetre...@gmail.com> wrote:

>  On 3/26/08, amarsibia <amarsi...@googlemail.com> wrote:

>  > Thank you so much i just couldn't find that syntax anywhere

>  Yeaph, I know...
>  This is one of new features paginate decorator has which isn't
>  documented already..  :(

Roger you're still alive!
I was waiting for this documentation! :-)

Cheers,
Florent.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google