[web2py] Pagination with web2py_utils

2018-08-30 Thread Mohammad Rostami
Hello.I used web2py_utils package to display paging. in controller: def weblog(): query= db.post.id > 0 orderby = ~db.post.created_on paginate = web2py_utils.paginate.Pagination(db, query, orderby ,display_count=2,r=request, res=response) posts=paginate

Re: [web2py] Pagination, only add var if it already exists?

2017-03-30 Thread r
I'm not quite sure, so would I do something like this? controller session.varName = request.var.name html: if session.varName: | Next like that ? On Thursday, 30 March 2017 15:51:00 UTC+1, Áureo Dias Neto wrote: > > example: > > use -> session.nome = 'teste'to store on the variable nome o

Re: [web2py] Pagination, only add var if it already exists?

2017-03-30 Thread Anthony
On Thursday, March 30, 2017 at 10:51:00 AM UTC-4, Áureo Dias Neto wrote: > > example: > > use -> session.nome = 'teste'to store on the variable nome of the > session of actual logged user.. > > and in the controller you can call the value of variable you have stored > This might now be the b

Re: [web2py] Pagination, only add var if it already exists?

2017-03-30 Thread Áureo Dias Neto
example: use -> session.nome = 'teste'to store on the variable nome of the session of actual logged user.. and in the controller you can call the value of variable you have stored 2017-03-30 11:47 GMT-03:00 r : > Forgot about that one, I'll read the documentation and try it out later. > Th

Re: [web2py] Pagination, only add var if it already exists?

2017-03-30 Thread r
Forgot about that one, I'll read the documentation and try it out later. Thanks On Thursday, 30 March 2017 15:45:23 UTC+1, Áureo Dias Neto wrote: > > hello, > > why note use session object? > > 2017-03-30 11:41 GMT-03:00 r >: > >> Hi, so my index page is like this: /index?page=1 I'm using paginat

Re: [web2py] Pagination, only add var if it already exists?

2017-03-30 Thread Áureo Dias Neto
hello, why note use session object? 2017-03-30 11:41 GMT-03:00 r : > 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 there is another var in the URL, it should carry that too > > /index

[web2py] Pagination, only add var if it already exists?

2017-03-30 Thread r
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 there is another var in the URL, it should carry that too /index?page=1&name=test becomes /index?page=2&name=test At the moment, I've done i

[web2py] Pagination with multiple controller using one view - best advice

2016-03-02 Thread Ron Chatterjee
Hello, I have at least 5 controller that I use one view by using response.view = 'default/view.html'. What would be the best advice in using pagination? Because following this: http://web2py.com/books/default/chapter/29/14/other-recipes?search=pagination#Pagination Leads to request.args problem

[web2py] Re: web2py pagination

2015-01-26 Thread Cássio Botaro
An example: http://mindbending.org/pt/paginando-consultas-web2py unfortunately in portuguese, but the code is clear. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report

[web2py] web2py pagination

2015-01-26 Thread Maurice Waka
Suppose I have such a code: def products(): if len(request.args): page=int(request.args[0]) else: page=0 items_per_page=20 limitby=(page*items_per_page,(page+1)*(items_per_page+1)) qset = db(db['products']['name']!='None') grid = qset.select(limitby=limitby) return dict(grid=grid,pag

[web2py] Pagination within a SQLFORM.factory

2014-11-28 Thread nick name
I want to let the user do a query and paginate through the resulting table. grid/smartgrid would be great, except that I need to supply the query through a form and not leave it open -- the query has minimum and maximum values for most fields, multiple selects for others (I build the search que

[web2py] pagination issue redirecting to the current page

2014-11-17 Thread Joe
I am working on an app where the user can select items by clicking on a button for each item on the index page. It works fine, except after each item selected the user has to be redirected to index and ends up on the top of the first page at item 1. Then the user has to go back each time and try

[web2py] Pagination with two queries

2014-05-02 Thread Ruud Schroen
Hi, I'm trying to use the pagination from web2py_utils with two queries. Usually the code looks like this: query = db.table.id > 0 count = db(query).count() results = db(query).select(orderby=~db.table.created_on) orderby = ~db.table.id pcache = (cache.ram, 15) paginate = web2py_utils.paginate.P

Re: [web2py] Pagination example from book. Make pages start at 1?

2014-02-19 Thread Derek
He means that he wants the page numbers to start at 1, not zero. My original reply has the fixed code. It's subtle, so you have to look for it. On Tuesday, February 18, 2014 11:56:43 PM UTC-7, mweissen wrote: > > What do you mean with "it reports as page 1"? > Do you mean the page number which i

Re: [web2py] Pagination example from book. Make pages start at 1?

2014-02-18 Thread Martin Weissenboeck
What do you mean with "it reports as page 1"? Do you mean the page number which is part of the URL? Or do you have a page numberin your view like {{=page}} 2014-02-18 23:18 GMT+01:00 HittingSmoke : > I followed the pagination tutorial in the web2py book and I have the > following controller: > >

[web2py] Pagination example from book. Make pages start at 1?

2014-02-18 Thread HittingSmoke
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=0 items_per_page=6 limitby=(page*items_per_page,(page+1)*items_per_page+1) posts=db().select(db.post.ALL, orderby=

[web2py] Pagination only using request.vars

2013-08-05 Thread Fabiano Faver
I have to paginate a search page that use a HTML form and request.vars to get the fields and values to search. As its is a dynamic form only two fields are fixed and the rest is dynamic. example: fixed request.vars.tpdoc = 1 request.vars.group = 3 dynamic request.vars.name = 'abc' request.vars.p

[web2py] pagination with web2py

2012-10-04 Thread Paulo Donizeti Gardinalli Filho
hi, I am starting to use web2py and I am very impressive with his facilities. I am a visualy empaired user and this framework is helping me. my dought is: How can I use pagination with web2py? thanks in advance! paulo --

[web2py] Pagination with no database

2012-07-23 Thread adohertyd
I have an application that returns a list of between 50-100 items. I have no database layer it isn't required for my app. I want to display 10 of those items on a page, and only generate the number of pages needed to view those results. Can anyone point me in the right direction (not the docs,

[web2py] Pagination issue in GAE using web2py

2012-01-12 Thread Saurabh S
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 record and my activities table contains user id for whom an activity has been cre

Re: [web2py] Pagination

2011-08-06 Thread Web2Py Freak
*This is the example in the book , how can i edit it to fit my table "db.blogpost" ?* db = DAL ('sqlite://primes.db') db.define_table('prime',Field ('value','integer')) def isprime(p):

Re: [web2py] Pagination

2011-08-06 Thread Bruno Rocha
db(db.posts.id>0).select(limitby=(0,10)) http://zerp.ly/rochacbruno Em 06/08/2011 05:00, "Web2Py Freak" escreveu: > Hey guys , > > Anyone Used Pagination before , i have a table named "blogpost" and i > want it to view every 10 post in a page , how can i do that ?? >

[web2py] Pagination

2011-08-06 Thread pbreit
Probably have to code it. There's an example in the book.

[web2py] Pagination

2011-08-06 Thread Web2Py Freak
Hey guys , Anyone Used Pagination before , i have a table named "blogpost" and i want it to view every 10 post in a page , how can i do that ??

Re: [web2py] Pagination

2011-07-15 Thread Anthony
Very cool. Thanks for the breakdown. Anthony On Friday, July 15, 2011 4:31:57 PM UTC-4, rochacbruno wrote: > On Fri, Jul 15, 2011 at 5:16 PM, Anthony wrote: > >> Is PowerGrid intended to have a different purpose from PowerTable, or is >> it just an alternative grid plugin? What are the diff

Re: [web2py] Pagination

2011-07-15 Thread Bruno Rocha
On Fri, Jul 15, 2011 at 5:16 PM, Anthony wrote: > Is PowerGrid intended to have a different purpose from PowerTable, or is it > just an alternative grid plugin? What are the differences? > PowerGrid is not only a grid plugin, besides the name it is a Paginator. One can use it to paginate anythin

Re: [web2py] Pagination

2011-07-15 Thread Anthony
Is PowerGrid intended to have a different purpose from PowerTable, or is it just an alternative grid plugin? What are the differences? Anthony On Friday, July 15, 2011 3:52:39 PM UTC-4, rochacbruno wrote: > PowerGrid does that http://labs.blouweb.com/PowerGrid > > I hope to release for downlo

Re: [web2py] Pagination

2011-07-15 Thread Bruno Rocha
PowerGrid does that http://labs.blouweb.com/PowerGrid I hope to release for download within a week or two... sorry, I have too much JavaScript to clear before make the plugin public. or, if you want to test it at your own risk.. I can send to you by email. On Fri, Jul 15, 2011 at 3:17 PM, contat

Re: [web2py] Pagination

2011-07-15 Thread contatogilson...@gmail.com
They are not good when you have thousands of records to be consulted. Do I need anyplugin that calls the paging of data via the database. _ *Gilson Filho* *Web Developer http://gilsondev.com*

Re: [web2py] Pagination

2011-07-15 Thread Gary Herron
On 07/15/2011 10:32 AM, contatogilson...@gmail.com wrote: Hello guys, I was wondering if anyone knows any plugin for web2py which makes data paging. _ *Gilson Filho* *Web Developer http://gilsondev.com* Both webgrid (a web2py plugin) and jqgrid (j

[web2py] Pagination

2011-07-15 Thread contatogilson...@gmail.com
Hello guys, I was wondering if anyone knows any plugin for web2py which makes data paging. _ *Gilson Filho* *Web Developer http://gilsondev.com*

[web2py] pagination previous and next on the controller

2011-05-14 Thread 黄祥
hi, i've test the pagination from : http://web2py.com/book/default/chapter/12?search=pagination#Pagination and tried to change the next and previous that on view into the controller e.g. from view: {{if page:}} previous {{pass}} {{if len(rows)>items_per_page:}} next {{pass}} into controller: d

Re: [web2py] Pagination in web2py

2011-04-12 Thread Tom Atkins
This worked for me: http://www.web2py.com/book/default/chapter/12#Pagination On 12 April 2011 11:16, Francisco Costa wrote: > Hi! > What is the ideal pagination method in web2py? > Are there any plugins or examples?

[web2py] Pagination in web2py

2011-04-12 Thread Francisco Costa
Hi! What is the ideal pagination method in web2py? Are there any plugins or examples?

Re: [web2py] Pagination, memory usage and grids(jqgrid, powerTable, webgrid)

2010-12-22 Thread Johann Spies
On 22 December 2010 14:01, rochacbruno wrote: > I am working on server side pagination/sorting/search for powerTable. > > Hope to finish soon. > > Thanks. I have since my previous email discovered that switching from the rocket server to apache makes a huge difference in speed and memory usage.

Re: [web2py] Pagination, memory usage and grids(jqgrid, powerTable, webgrid)

2010-12-22 Thread rochacbruno
I am working on server side pagination/sorting/search for powerTable. Hope to finish soon. Enviado via iPhone Em 22/12/2010, às 08:24, Johann Spies escreveu: > I work with tables of hundreds of thousands of records. Although jqgrid > seems faster than the other grids mentioned in the Subje

[web2py] Pagination, memory usage and grids(jqgrid, powerTable, webgrid)

2010-12-22 Thread Johann Spies
I work with tables of hundreds of thousands of records. Although jqgrid seems faster than the other grids mentioned in the Subject-line it still works too long when a large table is selected. All the abovementioned grids have their own pagination but it seems that they do not use that while query

[web2py] Pagination [Web2py Utils] returns None

2010-11-10 Thread Andrew Evans
Hello I am trying to create some pagination on my comments page everything seems to be working, however when I click the next link it goes to a page that all it says is None Anyone know why this is happening and how to fix it There are entries in the db. Thanks in Advance below is my code *che

[web2py] Pagination Issues [web2py_utils]

2010-10-04 Thread Andrew Evans
Hello I am having problems integrating my query in to my paginate code using web2py_utils. query = db(db.product.id > 0).select(db.product.ALL, groupby=db.product.category) orderby = db.product.product_name pcache = (cache.ram, 15) paginate = Pagination(db, query, orderby,

[web2py] [Pagination] need a bit of help

2010-10-01 Thread Andrew Evans
Hello I am trying to create some pagination for my site I am building. However this pagination is a bit messed up, (I forget exactly where I found it) when I click next it doesn't display anything else in the database. Also a few other things are rather odd about it. Does anyone have some good so

[web2py] Pagination manual bug?

2010-08-24 Thread dlin
ref: http://web2py.com/book/default/chapter/12#Pagination In following code, there is two problem: 1. The 'next' button always show. And the len(rows) always = 2 2. I don't know how to proper show the {{=rows}} without last row, I want to use the odd row background-color trick. I wrote simliar c

[web2py:34630] Re: web2py pagination

2009-11-04 Thread Wes James
You may want to take a look at t2.py and look itemize. T2 is deprecated, but you might still get some ideas from the code. http://www.web2py.com/examples/static/t2.pdf -wes On Wed, Nov 4, 2009 at 2:30 AM, Mengu wrote: > > hi everyone. > > i have a problem with paginating my results. i guess i

[web2py:34629] Re: web2py pagination

2009-11-04 Thread Vasile Ermicioi
perpage = 2 totalposts = db(db.post.id > 0).count() totalpages = totalposts / perpage page = int(request.vars.page) if request.vars.page else 1 limit = int(page - 1) * perpage posts = db(db.post.id > 0).select(orderby=~db.post.id, limitby=(limit+1,limit+perpage+1)) I changed just your last line. H

[web2py:34624] Re: web2py pagination

2009-11-04 Thread Mengu
sorry massimo, i didn't understand again. i guess i need some rest. can you explain me the web2py way of pagination? my algorithm is as the following: 1) set a limit to display per page. 2) get the total posts. 3) get the total pages by totalposts/perpage 4) get page via request.vars.page if exi

[web2py:34613] Re: web2py pagination with Datatables

2009-11-04 Thread mr.freeze
use Datatables; i am trying but not works. > > Or if anyone could send to me a example how i can use it. > > Regards. > > Fernando > --- On Wed, 11/4/09, mdipierro wrote: > > > From: mdipierro > > Subject: [web2py:34574] Re: web2py pagination> To: "web2p

[web2py:34609] Re: web2py pagination

2009-11-04 Thread mdipierro
All this does is when you do for row in db(...).select(limitby=(2,10)): print row it will skip the first two rows and loop over the remaining 10-2=8 rows. Massimo On Nov 4, 11:04 am, Mengu wrote: > hi massimo, > > i didn't undertand the pagination logic here. could you please > explain? > > s

[web2py:34608] Re: web2py pagination with Datatables

2009-11-04 Thread FERNANDO VILLARROEL
Hello All. Regarding of pagination. Anyone could me explain how i can use Datatables; i am trying but not works. Or if anyone could send to me a example how i can use it. Regards. Fernando --- On Wed, 11/4/09, mdipierro wrote: > From: mdipierro > Subject: [web2py:34574] Re:

[web2py:34591] Re: web2py pagination

2009-11-04 Thread Mengu
hi massimo, i didn't undertand the pagination logic here. could you please explain? sincerely Mengu On Nov 4, 5:30 pm, mdipierro wrote: > limitby=(a,b) > > returns rows[i] for a <= i < b > > On Nov 4, 3:30 am, Mengu wrote: > > > hi everyone. > > > i have a problem with paginating my results.

[web2py:34574] Re: web2py pagination

2009-11-04 Thread mdipierro
limitby=(a,b) returns rows[i] for a <= i < b On Nov 4, 3:30 am, Mengu wrote: > hi everyone. > > i have a problem with paginating my results. i guess i didn't > understand the logic in limitby. > > normally an sql query SELECT * FROM post LIMIT 2 OFFSET 0 displays the > first 2 results. And I ca

[web2py:34553] web2py pagination

2009-11-04 Thread Mengu
hi everyone. i have a problem with paginating my results. i guess i didn't understand the logic in limitby. normally an sql query SELECT * FROM post LIMIT 2 OFFSET 0 displays the first 2 results. And I can get the first 2 records with db (db.post.id>0).select(limitby(0,2)). so limit is 2 and off