I'm trying to use PaginateDataGrid, since it does everything I want a
grid to do :)
My problem is that I want to filter my select(). In my controller I
have something like this:
@turbogears.expose(template='my_template')
@turbogears.paginate('messages', default_order='timestamp')
def by_text_testing(self, text):
"""messages by text"""
messages = Message.select(Message.q.text.startswith(text))
return dict(messages=messages, grid=page_list, text=text)
where text is passed in from a form (a TableForm widget in fact).
This works fine, but the URLs that are generated for next page, page
N etc don't encode the 'text' parameter, making it fail after the
first page.
http://trac.turbogears.org/turbogears/ticket/719
says
"It even works if you are getting filtering info from a POST on your
controller because it will urlencode all the input_values when you
get the hrefs for the links."
so I think it should do what I want, but I can't get it to do it!
Arthur
--
He's a stranger to freedom
He's shackled to his fears and doubts
- Mary Gauthier
X-Google-Language: ENGLISH,ASCII-7-bit
Received: by 10.54.73.16 with SMTP id v16mr197354wra;
Mon, 22 May 2006 08:50:58 -0700 (PDT)
Return-Path: <[EMAIL PROTECTED]>
Received: from mail-gw0.york.ac.uk (mail-gw0.york.ac.uk [144.32.128.245])
by mx.googlegroups.com with ESMTP id v23si1060534cwb.2006.05.22.08.50.57;
Mon, 22 May 2006 08:50:58 -0700 (PDT)
Received-SPF: neutral (googlegroups.com: 144.32.128.245 is neither permitted
nor denied by best guess record for domain of [EMAIL PROTECTED])
Received: from [144.32.226.111] (rode.york.ac.uk [144.32.226.111])
by mail-gw0.york.ac.uk (8.13.6/8.13.6) with ESMTP id k4MFlh0N018678
for <[email protected]>; Mon, 22 May 2006 16:47:43 +0100 (BST)
Mime-Version: 1.0
Content-Type: text/plain
Message-Id: <[EMAIL PROTECTED]>
To: [email protected]
From: Arthur Clune <[EMAIL PROTECTED]>
Subject: PaginateDataGrid
Date: Mon, 22 May 2006 16:47:41 +0100
X-Mailer: Apple Mail (2.750)
X-York-MailScanner: Found to be clean
X-York-MailScanner-From: [EMAIL PROTECTED]
I'm trying to use PaginateDataGrid, since it does everything I want a
grid to do :)
My problem is that I want to filter my select(). In my controller I
have something like this:
@turbogears.expose(template='my_template')
@turbogears.paginate('messages', default_order='timestamp')
def by_text_testing(self, text):
"""messages by text"""
messages = Message.select(Message.q.text.startswith(text))
return dict(messages=messages, grid=page_list, text=text)
where text is passed in from a form (a TableForm widget in fact).
This works fine, but the URLs that are generated for next page, page
N etc don't encode the 'text' parameter, making it fail after the
first page.
http://trac.turbogears.org/turbogears/ticket/719
says
"It even works if you are getting filtering info from a POST on your
controller because it will urlencode all the input_values when you
get the hrefs for the links."
so I think it should do what I want, but I can't get it to do it!
Arthur
--
He's a stranger to freedom
He's shackled to his fears and doubts
- Mary Gauthier
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---