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:
On Tue, Mar 25, 2008 at 11:55 PM, amarsibia <amarsi...@googlemail.com> wrote:
> 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
> 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.
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 :))
> On Tue, Mar 25, 2008 at 11:55 PM, amarsibia <amarsi...@googlemail.com> wrote:
> > 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
> > 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.
> 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
> :))