My code for the pagination (next button)
Next
If there is a name, it will add it to the url however if there is no name,
it will add "none". Instead if it doesn't exist I don't want it to add
anything, just the page.
On Thursday, 30 March 2017 16:34:28 UTC+1, Anthony wrote:
>
> It is not quit
It is not quite clear what you are asking. Please show some code.
Anthony
On Thursday, March 30, 2017 at 10:41:50 AM UTC-4, r wrote:
>
> Hi, so my index page is like this: /index?page=1 I'm using pagination,
> when the user clicks on the next page, it should become: /index?page=2
>
> However if
Michele,
Thanks so much for this.
I tried to remove the select action and change the view as suggested but
that wasn't working. So, I experimented with the redirect from the select
action
to the index a couple of times.
I removed the request.vars.id, from the redirect and now it's working! The
Joe,
If you stay on page 1, it's because you do not pass the args parameter
correctly, when doing the redirect.
check you pass the variable page to the select() function and also that
when you redirect back to index you pass correctly the page as
request.args(0)
also simplify your code by removin
Hi Michele, thanks so much for looking at this problem. I appreciate it
very much. I tried the code but after selecting, the user is still sent
back to page 1 each time, not staying on the same page.
On Friday, January 2, 2015 10:18:44 PM UTC+8, Michele Comitini wrote:
>
> in the view links add
in the view links add the page and element id:
{{=A('Select', _id = i.id, _class="btn btn-danger",_href=URL("select", args=
i.id, vars=dict(id=i.id,page=page)))}}
{{elif i.selected:}}
{{=A('Selected', _id = i.id, _class="btn btn-info",_href=URL("select", args=
i.id, vars=dict(id=i.id, page=page <
The grid allows you to implement a custom search widget (via the
"search_widget" argument) as well as a custom server-side search function
(via the "searchable" argument) to build a query based on the keywords
returned by the widget. This isn't well documented, so you'll have to look
at the sou
@Massimo, Thanks very much Massimo. I am trying to find a way to redirect
the user to the page where the user clicks on the select button to select
an item. The user might be on page 2 or page 3 page 4 or any other page
when he selects the item. How can I redirect the user to the same page he
i
URL('index',args=(2)) will give you page #2.
On Monday, 17 November 2014 22:59:16 UTC-6, Joe wrote:
>
> Thanks Cliff, I've been trying to do that but I didn't succeed. I would
> appreciate if you could send an example on how to put the current page info
> in the request.args dictionary.
>
> On
Thanks Cliff, I've been trying to do that but I didn't succeed. I would
appreciate if you could send an example on how to put the current page info
in the request.args dictionary.
On Tuesday, November 18, 2014 12:37:09 PM UTC+8, Cliff Kachinske wrote:
>
> Put information about the current page i
Put information about the current page in the request.args dictionary. You
could use the session, but if your user opens a second browser window it
becomes difficult to keep track of which session data corresponds to which
browser tab.
On Friday, November 14, 2014 8:37:25 PM UTC-5, Joe wrote:
>
If the provinces are mutually exclusive (is that the case), of course there
won't be any records that match both of them. Do you perhaps want to use
"||" instead?
On Friday, May 2, 2014 7:01:02 AM UTC-4, Ruud Schroen wrote:
>
> I tried that, it returns zero results..
>
> Also when i print the qu
I tried that, it returns zero results..
Also when i print the query, this comes out:
((kamernet.province = 'Limburg') AND (kamernet.province = 'North Brabant'))
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- ht
please try (not tested):
query = (db.kamernet.province == 'Limburg') & (db.kamernet.province ==
'North Brabant')
best regards,
stifan
On Friday, May 2, 2014 5:45:15 PM UTC+7, Ruud Schroen wrote:
>
> Hi,
>
> I'm trying to use the pagination from web2py_utils with two queries.
> Usually the code
Well, this is really trivial isn't it?
On Tuesday, February 18, 2014 3:18:14 PM UTC-7, HittingSmoke wrote:
>
> I followed the pagination tutorial in the web2py book and I have the
> following controller:
>
> def index():
> if len(request.args): page=int(request.args[0])
> else: page=1
>
I suggest you download a copy of the web2py manual
(http://web2py.com/book). Read and run the snippet on pagination.
with a some tweaks you could as well achieve an infinite scroll pagination.
On Thursday, October 4, 2012 4:16:00 PM UTC+2, Paulo Donizeti Gardinalli
Filho wrote:
>
> hi, I am sta
grid = SQLFORM.grid(query)
{{=grid}}
will display the records with pagination.
On Thursday, 4 October 2012 09:16:00 UTC-5, Paulo Donizeti Gardinalli Filho
wrote:
>
> hi, I am starting to use web2py and I am very impressive with his
> facilities. I am a visualy empaired user and this framework
Usually you have some means to "order" the records (e.g., a "id" field that
is 1,2,3,4,5, a "name" field that is a,b,c,d, an inserted_on datetime
field that is 2012-07-23m, 2012-07-24, etc etc etc).
When the order of the records is established in a list:
all_records = ['a','b','c','d',...]
Thank you for that makes perfect sense. This might be a stupid question but
do I need to create an individual HTML page for each result set? The whole
pagination thing is a mystery to me!
On Monday, 23 July 2012 21:33:34 UTC+1, Niphlod wrote:
>
> That's math!
> e.g.
> records_per_page = 10 recor
That's math!
e.g.
records_per_page = 10 records
all_records = 137 records
pages_needed = all_records / records_per_page (division)
last_page = all_records % records_per_page (module)
that is 13 "full pages" + 1 page with 7 records.
So, you'll have to count the total of your records, divide it by
to play this game on GAE:
- consider de-normalizing the data and storing a list of activities on
each user record.
- get the data from table X, then do a query on table Y like:
"db(db.Y.id.belongs(keys).select()" where keys is a list of IDs from the
first query. remember that GAE limits belo
SQLFORM.grid does pagination
On Jan 12, 8:53 am, Saurabh S wrote:
> Hi,
>
> I am developing an online booking application in python using web2py
> framework on google app engine.
>
> I have two tables, one is users table and other is activities table.
> My users table contains user id for each r
You can put anywhere you like. If it goes in a module, you need to
import it.
Because of the new custom import and current. This is no longer a
problem.
Any module imported by a model or controller can do from gluon import
current, DIV, SQLHTML, etc. and get access to everything. current
contains
Where does the class go? In a module?
I still don't fully understand "current". Is that an easy way for a module
to have access to the whole current environment?
You can do something like this:
class Paginator(DIV):
items_per_page = 10
records = 100
def limitby(self):
from gluon import current
page = self.page=int(current.request.vars.page or 0)
return (self.items_per_page*page,self.items_per_page*(page
+1))
Have you seen this section in the book:
http://web2py.com/book/default/chapter/12#Pagination?
The PowerTable plugin uses DataTables, which allows server-side processing,
including pagination. jqGrid also allows server-side pagination.
Anthony
On Friday, July 15, 2011 1:32:53 PM UTC-4, Gilson
thank you so much for your hints and pointers, pbreit. i've already read the
url, but still don't understand, what is the intent of the url. but i get it
what you've said, again thank you very much.
On Mon, May 16, 2011 at 12:44 AM, pbreit wrote:
> You could check out this approach:
> http://pac
You could check out this approach:
http://packages.python.org/web2py_utils/paginate.html
{{ }} *ONLY* work in views. The other thing you could consider if you want
to put it in a controller, model or module is using HTML tag helpers like
this:
if page:
previous = A('previous', _href=UR
i've already tried to moved curly brackets {{ }} in the controllers and
still gettin an error, my intention is because all of my views is using
pagination and i want to simplified it to just put on the centralize db
functions.
is there any ways to do this?
thank you so much
On Sun, May 15, 2011 at
You don't put {{ and }} in controllers. Just do it like it is in the book.
HTML typically belongs in the view.
Hello, see web2py util project here:
http://packages.python.org/web2py_utils/paginate.html I have a good
experinece with this.
For more advanced solutions you an use this:
http://www.web2pyslices.com/main/slices/take_slice/39
David
The thing is that I use paginations on a lot of different controllers,
and I would love to have a more generic solution
On Apr 12, 11:29 am, Tom Atkins wrote:
> This worked for me:
>
> http://www.web2py.com/book/default/chapter/12#Pagination
>
> On 12 April 2011 11:16, Francisco Costa wrote:
>
Thanks. I uploaded a new version to pypi.
--
Thadeus
On Fri, Nov 12, 2010 at 10:27 AM, Andrew Evans wrote:
> Hey Thadeus!
>
> where would you like me to submit it? I can upload it here to this news
> group. The only thing I changed was what you suggested ;) adding self.r.args
> to the genera
Hey Thadeus!
where would you like me to submit it? I can upload it here to this news
group. The only thing I changed was what you suggested ;) adding self.r.args
to the generate links function ;)
def generate_links(self):
self.backward = A('<< previous()', _href=URL(r=self.r,
args=self.r
Mind sending me a patch?
--
Thadeus
On Thu, Nov 11, 2010 at 6:02 PM, Andrew Evans wrote:
> hey thanks for the tips
>
> I have it working now
>
> *cheers
>
> Andrew
>
hey thanks for the tips
I have it working now
*cheers
Andrew
There are two alternatives.
Have the generate_links function assume args when creating the url. This
could be based on the existing args in request.
URL(r=self.r, args=self.r.args)
Or patch get_set to allow passing args as part of the function declaration,
it would in turn pass these args to the
Hello ty for the reply
You wouldn't by chance be able to help me with a patch. Your talking about
the paginate.py file to patch set_links in there or with in the set_links
value in my code?
Your the developer of Web2py Utils is that correct?
Nice work on it :D
*cheers
Andrew
On Wed, Nov 10,
Its losing the args when it creates a new URL. It will require a patch on
set_links so you can pass custom args and vars to URL.
--
Thadeus
On Wed, Nov 10, 2010 at 4:36 PM, Andrew Evans wrote:
> I just noticed the difference in URLs
>
> https://127.0.0.1:8000/Working/display/product_wall/405
I just noticed the difference in URLs
https://127.0.0.1:8000/Working/display/product_wall/4056
above is the comments on the product notice the id.
below is the next link of the pagination
https://www.127.0.0.1:8000/Working/display/product_wall?p=5
it loses the 4056 which is the id of the produ
@dlin: it doesn't works because URL helper has been "improved" lately,
in case you were asking yourself.
PS: sadly if you put "web2py pagination" on google, the first link
that appears is from mengu.net and that implementation is wrong, also
if the analysis is correct.
limitby works like python
This is not a bug. the manual syntax is correct for web2py 1.83.1 and
beyond.
On Aug 24, 10:56 pm, dlin wrote:
> As I know, at least this is manual's bug.
>
> In the mannual, it use
> next
>
> But, it will raise error, I use this line instead
> next
>
> On 8月25日, 上午1時55分, Vidul Petrov wrote:
>
>
As I know, at least this is manual's bug.
In the mannual, it use
next
But, it will raise error, I use this line instead
next
On 8月25日, 上午1時55分, Vidul Petrov wrote:
> Not sure if this help, but you may want to take a look at this
> Pagination class:http://packages.python.org/web2py_utils/paginat
Not sure if this help, but you may want to take a look at this
Pagination class:
http://packages.python.org/web2py_utils/paginate.html
On Aug 24, 6:37 pm, dlin wrote:
> ref:http://web2py.com/book/default/chapter/12#Pagination
>
> In following code, there is two problem:
> 1. The 'next' button alw
44 matches
Mail list logo