Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
can results page be split up?
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
  21 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
geekbuntu  
View profile  
 More options Nov 7 2009, 10:22 am
From: geekbuntu <gmi...@gmail.com>
Date: Sat, 7 Nov 2009 07:22:38 -0800 (PST)
Local: Sat, Nov 7 2009 10:22 am
Subject: can results page be split up?
i have a wicked long list of used books - wondering if i can sort them
with links?

http://pairadice.no-ip.org:8080/books

(around 4500)


    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.
Angelo Gladding  
View profile  
 More options Nov 7 2009, 2:09 pm
From: Angelo Gladding <ang...@gladding.name>
Date: Sat, 7 Nov 2009 11:09:07 -0800
Local: Sat, Nov 7 2009 2:09 pm
Subject: Re: [webpy] can results page be split up?

Can you clarify what it is you mean by "sort them with links"? Are you
dealing w/ raw HTML or are you sending an unsorted list to a template?

On Sat, Nov 7, 2009 at 7:22 AM, geekbuntu <gmi...@gmail.com> wrote:

> i have a wicked long list of used books - wondering if i can sort them
> with links?

> http://pairadice.no-ip.org:8080/books

> (around 4500)

--
Angelo Gladding
ang...@gladding.name
http://angelo.gladding.name/
E69E 47E8 5C3A 96E5 C70F
D931 F35C ACBA 6F39 9611

    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.
Greg Milby  
View profile  
 More options Nov 7 2009, 3:15 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sat, 7 Nov 2009 15:15:15 -0500
Local: Sat, Nov 7 2009 3:15 pm
Subject: Re: [webpy] Re: can results page be split up?

it's a fetchall returned from a mysql query (so raw rows that are just being
listed out in a <ol><li></li>.... for the time being)

On Sat, Nov 7, 2009 at 2:09 PM, Angelo Gladding <ang...@gladding.name>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.
Greg Milby  
View profile  
 More options Nov 7 2009, 3:16 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sat, 7 Nov 2009 15:16:16 -0500
Local: Sat, Nov 7 2009 3:16 pm
Subject: Re: [webpy] Re: can results page be split up?

here's the link of the raw query:

http://pairadice.no-ip.org:8080/books

<http://pairadice.no-ip.org:8080/books>

On Sat, Nov 7, 2009 at 2:09 PM, Angelo Gladding <ang...@gladding.name>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.
Greg Milby  
View profile  
 More options Nov 7 2009, 4:55 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sat, 7 Nov 2009 16:55:47 -0500
Local: Sat, Nov 7 2009 4:55 pm
Subject: Re: [webpy] Re: can results page be split up?

actually i was trying to learn how to paginate in webpy.

On Sat, Nov 7, 2009 at 2:09 PM, Angelo Gladding <ang...@gladding.name>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.
Leon Waldman  
View profile  
 More options Nov 7 2009, 5:28 pm
From: Leon Waldman <le.wald...@gmail.com>
Date: Sun, 8 Nov 2009 00:28:12 +0200
Local: Sat, Nov 7 2009 5:28 pm
Subject: Re: [webpy] Re: can results page be split up?

Hi,

AFAIK, you can do it on the SQL...

Cheers

--
Leon Waldman
SysAdmin Linux - Arquiteto de Infra-Estrutura & TI.


    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.
Greg Milby  
View profile  
 More options Nov 7 2009, 7:56 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sat, 7 Nov 2009 19:56:09 -0500
Local: Sat, Nov 7 2009 7:56 pm
Subject: Re: [webpy] Re: can results page be split up?

what is afaik?


    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.
alexander lind  
View profile  
 More options Nov 7 2009, 7:58 pm
From: alexander lind <a...@polkabrothers.com>
Date: Sat, 7 Nov 2009 19:58:04 -0500
Local: Sat, Nov 7 2009 7:58 pm
Subject: Re: [webpy] Re: can results page be split up?

as far as i know.
On Nov 7, 2009, at Nov 7, 2009 - 7:56 PM, Greg Milby 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.
Greg Milby  
View profile  
 More options Nov 7 2009, 9:02 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sat, 7 Nov 2009 21:02:11 -0500
Local: Sat, Nov 7 2009 9:02 pm
Subject: Re: [webpy] Re: can results page be split up?

ah - ty

On Sat, Nov 7, 2009 at 7:58 PM, alexander lind <a...@polkabrothers.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.
Angelo Gladding  
View profile  
 More options Nov 7 2009, 10:24 pm
From: Angelo Gladding <ang...@gladding.name>
Date: Sat, 7 Nov 2009 19:24:41 -0800
Local: Sat, Nov 7 2009 10:24 pm
Subject: Re: [webpy] Re: can results page be split up?

As raw SQL:

SELECT * FROM `books` ORDER BY `title` ASC LIMIT 0, 10
SELECT * FROM `books` ORDER BY `title` ASC LIMIT 10, 20

Using web.db:

db.select('books', order='title', offset=0, limit=10)
db.select('books', order='title', offset=10, limit=20)

see http://webpy.org/cookbook/select

Try something like this:

paths = ('/books', 'Books')
app = web.application(paths, globals())

class Books:
  def GET(self):
    """
    >>> assert app.request('/books?p=4').status == '200 OK'

    """
    try:
      offset = web.input('p').p * 10
    except web.badrequest:
      return list(db.select('books', order='title'))
    return list(db.select('books', order='title', offset=offset, limit=10))

Let me know if that helps.

--
Angelo Gladding
ang...@gladding.name
http://angelo.gladding.name/
E69E 47E8 5C3A 96E5 C70F
D931 F35C ACBA 6F39 9611

    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.
Anand Chitipothu  
View profile  
 More options Nov 8 2009, 12:19 am
From: Anand Chitipothu <anandol...@gmail.com>
Date: Sun, 8 Nov 2009 10:49:10 +0530
Local: Sun, Nov 8 2009 12:19 am
Subject: Re: [webpy] Re: can results page be split up?

Small correction.

web.input('p').p returns a string. It must be converted to int before
multiplying with 10.
Also p must be optional parameter.

try:
    p = int(web.input(p=0).p)
except ValueError:
    p = 0

offset = p*10


    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.
Justin Caratzas  
View profile  
 More options Nov 7 2009, 10:58 pm
From: Justin Caratzas <justin.carat...@gmail.com>
Date: Sat, 7 Nov 2009 19:58:17 -0800
Local: Sat, Nov 7 2009 10:58 pm
Subject: Re: [webpy] Re: can results page be split up?

or using javascript/JQuery, if you use a standard html table

Justin Caratzas


    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.
Greg Milby  
View profile  
 More options Nov 8 2009, 6:09 am
From: Greg Milby <gmi...@gmail.com>
Date: Sun, 8 Nov 2009 06:09:09 -0500
Local: Sun, Nov 8 2009 6:09 am
Subject: Re: [webpy] Re: can results page be split up?

the query is getting this error:
<type 'exceptions.SyntaxError'> at / ('invalid syntax',
('/media/ST250x01/BACKUP/webpy/myapp.py', 24, 43, " showbooks =
db.select('books' order='title', offset=10, limit=20)\n"))

here's how i'm using it:
 16 class index:
 17     def GET(self):
 18         welcome = 'Welcome'
 19         return render.index(welcome)
 20
 21 class books:
 22     def GET(books):
 23         db = web.database(dbn='mysql', user='root', pw='', db='books
')
 24         showbooks = db.select('books' order='title', offset=10,
limit=20)
 25         return render.books(showbooks)

On Sat, Nov 7, 2009 at 10:24 PM, Angelo Gladding <ang...@gladding.name>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.
Greg Milby  
View profile  
 More options Nov 8 2009, 6:10 am
From: Greg Milby <gmi...@gmail.com>
Date: Sun, 8 Nov 2009 06:10:50 -0500
Local: Sun, Nov 8 2009 6:10 am
Subject: Re: [webpy] Re: can results page be split up?

nvm - i forgot a comma - thank you
will try your code below - adapt it to this. thanks for the help

On Sun, Nov 8, 2009 at 12:19 AM, Anand Chitipothu <anandol...@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.
Greg Milby  
View profile  
 More options Nov 8 2009, 6:19 am
From: Greg Milby <gmi...@gmail.com>
Date: Sun, 8 Nov 2009 06:19:53 -0500
Local: Sun, Nov 8 2009 6:19 am
Subject: Re: [webpy] Re: can results page be split up?

i tried that - liked the idea, but it didn't go well.
i wrote  ascript to make the js (jQuery) data format - but if you look, it
displays tons of empty pages at the end, was never able to figure out why -
data is formatted to jQuery spec's
http://pairadice.no-ip.org/booknook/virt/

On Sat, Nov 7, 2009 at 10:58 PM, Justin Caratzas
<justin.carat...@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.
Justin Caratzas  
View profile  
 More options Nov 8 2009, 2:19 pm
From: Justin Caratzas <justin.carat...@gmail.com>
Date: Sun, 8 Nov 2009 11:19:39 -0800
Local: Sun, Nov 8 2009 2:19 pm
Subject: Re: [webpy] Re: can results page be split up?
I'm assuming you got that problem fixed, because I just checked that link and it seems to work fine.  The last 8 pages or so have data.

Justin

ps.  Is this for the Book Nook franchise of used book stores?  I love that place.


    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.
Greg Milby  
View profile  
 More options Nov 8 2009, 12:32 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sun, 8 Nov 2009 12:32:40 -0500
Local: Sun, Nov 8 2009 12:32 pm
Subject: Re: [webpy] Re: can results page be split up?

yes, i actually discovered what was wrong on the jquery pagination.  i may
run with that since it would reduce the load on the webserver. thank you

On Sun, Nov 8, 2009 at 2:19 PM, Justin Caratzas
<justin.carat...@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.
Angelo Gladding  
View profile  
 More options Nov 8 2009, 12:58 pm
From: Angelo Gladding <ang...@gladding.name>
Date: Sun, 8 Nov 2009 09:58:03 -0800
Local: Sun, Nov 8 2009 12:58 pm
Subject: Re: [webpy] Re: can results page be split up?

Keep in mind non-js users!! :) The load is likely to be mostly on the
database end anyway.

--
Angelo Gladding
ang...@gladding.name
http://angelo.gladding.name/
E69E 47E8 5C3A 96E5 C70F
D931 F35C ACBA 6F39 9611

  no-js.png
21K Download

    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.
Greg Milby  
View profile  
 More options Nov 8 2009, 1:13 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sun, 8 Nov 2009 13:13:44 -0500
Local: Sun, Nov 8 2009 1:13 pm
Subject: Re: [webpy] Re: can results page be split up?

creating, handling and manipulating the db requests is the bulk of my
load... i do not mind it, but why push spikes if i don't have to?

On Sun, Nov 8, 2009 at 12:58 PM, Angelo Gladding <ang...@gladding.name>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.
Greg Milby  
View profile  
 More options Nov 8 2009, 5:43 pm
From: Greg Milby <gmi...@gmail.com>
Date: Sun, 8 Nov 2009 17:43:15 -0500
Local: Sun, Nov 8 2009 5:43 pm
Subject: Re: [webpy] Re: can results page be split up?

i would still like to know how to paginate in python *if anyone has figured
it out - even though i will probably use jquery. i do not know where to
begin with passing the links/code in and out of the template layer...

 21 class books:
 22     def GET(books):
 23         db = web.database(dbn='mysql', user='root', pw='', db='books')
 24         showbooks = db.select('books', order='title', offset=10,
limit=20)
 25         return render.books(showbooks)


    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.
Justin Caratzas  
View profile  
 More options Nov 8 2009, 9:12 pm
From: Justin Caratzas <justin.carat...@gmail.com>
Date: Sun, 8 Nov 2009 18:12:01 -0800
Local: Sun, Nov 8 2009 9:12 pm
Subject: Re: [webpy] Re: can results page be split up?
use a hidden field for the current page number, then set the offset to page * limit.  atleast, thats how i've seen it done before.  that could be taken a step further by ajax.

Justin


    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
©2010 Google