Dictionary pagination

2009-11-04 Thread David
Hello, I just wonder if anybody has handled this before. Here is a 2-D dictionary. dict[key_1] = {'a':'aa', 'b':'bb', 'c':'cc'} dict[key_2] = {'a':'dd', 'b':'ee', 'c':'ff'} dict[key_3] = {'a':'eef', 'b': 'ff', 'c':'ghh'} Assume that this dict is so long that I need to paginate. Do

Pagination - django.views.generic.list_detail.object_detail

2009-11-02 Thread Mario
Hello, Which Pagination tag do you all recommend for handling django.views.generic.list_detail.object_detail? I have an existing article which requires pagination. I don't want the user to keep scrolling down the web page. _Mario --~--~-~--~~~---~--~

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-21 Thread tezro
gt; > On Aug 30, 2:47 pm, tezro wrote: > > > > > > > Anyone? > > > > > > > On Aug 14, 8:29 am, tezro wrote: > > > > > > > > The question is that > > > > "django.views.generic.date_based.

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-19 Thread Михаил Лукин
> The question is that > > > "django.views.generic.date_based.archive_index()" > > > > > > takes an optional argument "num_latest" which is 15 by default. > > > > > > Setting it manually to num_latest=10 is way off to >

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-19 Thread tezro
tezro wrote: > > > > > > The question is that > > "django.views.generic.date_based.archive_index()" > > > > > takes an optional argument "num_latest" which is 15 by default. > > > > > Setting it manually to num_l

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread Михаил Лукин
t; Setting it manually to num_latest=10 is way off to correct to > > > > me. It works. I suppose that it even doesn't retrieve all the tons of > > > > data from the DB, but what if I have 10 + 1 record :) > > > > > > What's the

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread tezro
ent "num_latest" which is 15 by default. > > > Setting it manually to num_latest=10 is way off to correct to > > > me. It works. I suppose that it even doesn't retrieve all the tons of > > > data from the DB, but what if I have 10 + 1 record :)

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-10-18 Thread Mihail Lukin
It works. I suppose that it even doesn't retrieve all the tons of > > data from the DB, but what if I have 10 + 1 record :) > > > What's the right way to use "django-pagination" and the "archive_index > > ()" or am I missing something?

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Brian McKeever
Oh, it's just a preference. I don't like calculating stuff in the template. It violates the MVT pattern to some minor degree. On Sep 25, 6:41 am, Bryan wrote: > I can't think of a reason, if nothing else its a matter or taste/ > preference.  He said "I would probably...", so he may have been > i

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Brian McKeever
.count uses a sql function that just counts the rows. Doing len(model.objects.all()) pulls ALL of the objects from the database including all of the associated data and then counts them. It should be a significant performance difference for any large data set. On Sep 24, 11:12 am, Chris Withers

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Bryan
I can't think of a reason, if nothing else its a matter or taste/ preference. He said "I would probably...", so he may have been implying that there was a technical reason but most likely he was just stating his preference. On Sep 25, 5:03 am, Chris Withers wrote: > Jani Tiainen wrote: > > Chri

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Chris Withers
Jani Tiainen wrote: > Chris Withers kirjoitti: >> Brian McKeever wrote: >>> .count is definitely the way to go. Although, I would probably pass it >>> to your template instead of determining it there. >> What difference does it make? > > len(qs) evaluates queryset - thus pulling in _every_ object

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Daniel Roseman
On Sep 25, 9:08 am, Jani Tiainen wrote: > Chris Withers kirjoitti: > > > Brian McKeever wrote: > >> .count is definitely the way to go. Although, I would probably pass it > >> to your template instead of determining it there. > > > What difference does it make? > > len(qs) evaluates queryset - th

Re: is this a sane way to show total number of objects in pagination?

2009-09-25 Thread Jani Tiainen
Chris Withers kirjoitti: > Brian McKeever wrote: >> .count is definitely the way to go. Although, I would probably pass it >> to your template instead of determining it there. > > What difference does it make? len(qs) evaluates queryset - thus pulling in _every_ object from DB to Python - which

Re: is this a sane way to show total number of objects in pagination?

2009-09-24 Thread Chris Withers
Brian McKeever wrote: > .count is definitely the way to go. Although, I would probably pass it > to your template instead of determining it there. What difference does it make? Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co

Re: is this a sane way to show total number of objects in pagination?

2009-09-24 Thread Brian McKeever
.count is definitely the way to go. Although, I would probably pass it to your template instead of determining it there. On Sep 24, 10:32 am, Chris Withers wrote: > Chris Withers wrote: > >      objects = model.objects.all() > >      paginator = Paginator(objects,10) > >      return render_to_re

Re: is this a sane way to show total number of objects in pagination?

2009-09-24 Thread Chris Withers
Chris Withers wrote: > objects = model.objects.all() > paginator = Paginator(objects,10) > return render_to_response( > 'index.html',dict( > objects = paginator.page(page), > total_objects = len(objects), > ) > ) I'm guessing

is this a sane way to show total number of objects in pagination?

2009-09-24 Thread Chris Withers
Hi All, I have the following in a view: objects = model.objects.all() paginator = Paginator(objects,10) return render_to_response( 'index.html',dict( objects = paginator.page(page), total_objects = len(objects), ) ) Is that

Re: digg style pagination

2009-09-07 Thread Michael Ralan
It's possible to get digg-style pagination yes. What you need to do is this. Get the django-pagination add-on from the following url http://code.google.com/p/django-pagination/ The documentation says unzip the pagination folder to a path accessible to python. This is usually taken to mean

Re: django pagination

2009-09-05 Thread Karen Tracey
On Sat, Sep 5, 2009 at 4:52 PM, Michael Ralan wrote: > > Hi, > > Apologies if this question has been asked before but I was not able to > find a satisfactory answer. > > In the django admin app there is a capability to have a pagination > object that lists the number of

django pagination

2009-09-05 Thread Michael Ralan
Hi, Apologies if this question has been asked before but I was not able to find a satisfactory answer. In the django admin app there is a capability to have a pagination object that lists the number of pages that can be paged. I have found code that uses the django Paginator object which

Re: "django-pagination" and generic.views.date_based.archive_index()

2009-08-30 Thread tezro
It works. I suppose that it even doesn't retrieve all the tons of > data from the DB, but what if I have 10 + 1 record :) > > What's the right way to use "django-pagination" and the "archive_index > ()" or am I missing something? > > Example co

Multiple pagination on a sinle page.

2009-08-18 Thread Sonal Breed
Hi all, In my application, I want to have pagination for multiple objects (Friends, Stories) on a single page. Problem is if I click next on one of the paginated objects, all the paginated objects on the page move to next page. How do I accomplish individual pagination on a single page for

Re: digg style pagination

2009-08-17 Thread sniper
at around the > net. I'm quite fond of this[2] one because it extends the built-in > pagination facilities instead of completely reinventing the wheel. > > Kind regards, > Benjamin > > [1]http://code.djangoproject.com/browse

Re: digg style pagination

2009-08-14 Thread Benjamin Wohlwend
loat around the net. I'm quite fond of this[2] one because it extends the built-in pagination facilities instead of completely reinventing the wheel. Kind regards, Benjamin [1] http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/templatetags/admin_list

Re: digg style pagination

2009-08-14 Thread sniper
, 2009 at 2:54 PM, sniper wrote: > > > I am trying to do pagination. Just wanted to know if there is a > > shortcut to show digg style pagination or i have to write my own? > > I am asking this because in the admin page, the list page uses digg > > style paging. --~--~---

Re: digg style pagination

2009-08-14 Thread David Zhou
http://tinyurl.com/mj29fw -- dz On Fri, Aug 14, 2009 at 2:54 PM, sniper wrote: > > I am trying to do pagination. Just wanted to know if there is a > shortcut to show digg style pagination or i have to write my own? > I am asking this because in the admin page, the list page uses

digg style pagination

2009-08-14 Thread sniper
I am trying to do pagination. Just wanted to know if there is a shortcut to show digg style pagination or i have to write my own? I am asking this because in the admin page, the list page uses digg style paging. --~--~-~--~~~---~--~~ You received this message

"django-pagination" and generic.views.date_based.archive_index()

2009-08-13 Thread tezro
of data from the DB, but what if I have 10 + 1 record :) What's the right way to use "django-pagination" and the "archive_index ()" or am I missing something? Example code. ___ def index(request): qs = News.objects.filter(is_published=

Re: Pagination in the admin , where is?

2009-08-06 Thread Asinox
ox wrote: > > > > > Well, i cant find any about it, i want to know if the pagination exist > > in the admin... i think that "yes"..but .. i cant see any thing > > about.. > > > thanks --~--~-~--~~~---~--~~ You receive

Re: Pagination in the admin , where is?

2009-08-06 Thread Adam V.
the pagination exist > in the admin... i think that "yes"..but .. i cant see any thing > about.. > > thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Pagination in the admin , where is?

2009-08-06 Thread Asinox
Well, i cant find any about it, i want to know if the pagination exist in the admin... i think that "yes"..but .. i cant see any thing about.. thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &qu

django-pagination with search form

2009-08-06 Thread Streamweaver
Simple Pagination in Django is great but I'm having some trouble with the best way to design pagination with querysets derived from Search Forms. I'm currently using the Django-Pagination middleware and it works great but there's really pretty bad documentation on it (as with man

Re: Searchform with pagination and GET parameters - easy solution needed

2009-08-05 Thread Alex Gaynor
On Wed, Aug 5, 2009 at 10:03 AM, tom wrote: > > Hi folks, > > i want to build a searchform (with GET parameters) and also want to > use pagination. But i can't find an easy solution for this common > case. > My solution has a searchform, a view and a template. Can anyb

Searchform with pagination and GET parameters - easy solution needed

2009-08-05 Thread tom
Hi folks, i want to build a searchform (with GET parameters) and also want to use pagination. But i can't find an easy solution for this common case. My solution has a searchform, a view and a template. Can anybody tell me if this is a good solution? I'm not sure because i fi

Re: Simple Pagination Problem

2009-07-29 Thread Alex Gaynor
On Wed, Jul 29, 2009 at 10:04 AM, Mark wrote: > > Ye thats what I was afraid of - i was hoping there was something in > the Pagination object that would help me out. > But I cant see anything. > > Maybe someone will point it out after I have implemented the above. > > Tha

Re: Simple Pagination Problem

2009-07-29 Thread Mark
Ye thats what I was afraid of - i was hoping there was something in the Pagination object that would help me out. But I cant see anything. Maybe someone will point it out after I have implemented the above. Thanks. On Jul 29, 3:58 pm, cootetom wrote: > You may have to do a bit of computat

Re: Simple Pagination Problem

2009-07-29 Thread cootetom
You may have to do a bit of computation back on the server in python code to get the data you're after. From the pagination object you know what page you are currently on, you also know how many items are on a page so: last_item = page_num * items_per_page first_item = last_item - items_per

Re: Simple Pagination Problem

2009-07-29 Thread Mark
1 of 23. Showing 10resultsper page" > > I am just lost on how to do this. > > On Jul 29, 3:44 pm, krylatij wrote: > > > Read > > documentationhttp://www.djangoproject.com/documentation/models/pagination/ --~--~-~--~~~---~--~~ You receiv

Re: Simple Pagination Problem

2009-07-29 Thread Mark
Thanks, but I have been. Its still not clear - To date I have always been displaying "Page 1 of 23. Showing 10 results per page" I am just lost on how to do this. On Jul 29, 3:44 pm, krylatij wrote: > Read > documentationhttp://www.djangoproject.com/documentation/m

Re: Simple Pagination Problem

2009-07-29 Thread cootetom
Yes, have a read of the documentation. When you create a pagination class you have access to all the variables needed that tell you how many pages there are, what page you are currently on etc. http://docs.djangoproject.com/en/dev/topics/pagination/#topics-pagination On Jul 29, 3:15 pm, Aldo

Re: Simple Pagination Problem

2009-07-29 Thread krylatij
Read documentation http://www.djangoproject.com/documentation/models/pagination/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj

Simple Pagination Problem

2009-07-29 Thread Aldo
I want to display to my html page Displaying results 1- 10 of 55322 found. Is there something straight forward in the pagination to do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&q

Disabling admin pagination.

2009-07-01 Thread kurak
Hello, I'd like to add another button "show all" after pagination numbers, so I could optionally show all records on one page. Is there any way to do this without patching django? Thanks, K --~--~-~--~~~---~--~~ You received this message because you

Re: Export to excel sheet in djanogo using pagination

2009-04-24 Thread Tim Chase
> I have many pages to be exported to the excel sheet. I use django and > javascript. > i use pagination. Can any one help me out ? Just create a custom view that returns apropos content/headers. There are several ways of exporting files that Excel can read. CSV files: == +eas

Export to excel sheet in djanogo using pagination

2009-04-23 Thread Nalini
Hi, I have many pages to be exported to the excel sheet. I use django and javascript. i use pagination. Can any one help me out ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: pagination

2009-03-30 Thread Bartek SQ9MEV
Konstantin S pisze: > Hello! > second one I found at code.google.com. (Url is > http://code.google.com/p/django-pagination/). Which one would you > recommend ? This one works well for me (it uses the built-one), but remember not to use {% if object_list %} before pagination tags in y

Re: pagination

2009-03-30 Thread Benjamin Buch
django-pagination makes use of the Djangos' built in pagination, so it's more like a wrapper on top but no distinct 'engine'. If you have a need for some special customized pagination, I would recommend Djangos' own pagination, but if you want easy setup and som

Re: pagination

2009-03-30 Thread Briel
Hi I haven't actually used django's own pagination, so I guess I can't really compare. Though working with django-pagination is really easy and it's well written. Made by the people that made pinax... ~Jakob On 30 Mar., 12:36, Konstantin S wrote: > Hello! > >

pagination

2009-03-30 Thread Konstantin S
Hello! I noticed that there are two paginations 'engines' available for django. The first one is in django distribution itself (http://docs.djangoproject.com/en/1.0/topics/pagination/), and the second one I found at code.google.com. (Url is http://code.google.com/p/django-pagination/).

Re: pagination django

2009-03-25 Thread Joe
nicemira wrote: > please friends, > how can I paginate my product with this method: I want to do a newline > after every two products Doing a newline after every two products is not pagination. Here is an example that adds a horizontal rule after every two products: {% for product in

Re: pagination django

2009-03-25 Thread Justin Lilly
I believe you're looking for the {% cycle %} template tag, which you can find more information about here: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#cycle {% cycle '' '' %} -justin On Wed, Mar 25, 2009 at 6:15 AM, nicemira wrote: > > please friends, > how can I paginate my

pagination django

2009-03-25 Thread nicemira
please friends, how can I paginate my product with this method: I want to do a newline after every two products please,answer me as soon as possible --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: pagination problem with "Next" and saving results as a dictionary

2009-03-16 Thread Jesse
Hello Paul, Thanks!! I'll try it. On Mar 13, 2:21 pm, pkenjora wrote: > Uhm maybe this post will help its a tag that handles thepaginationon > query objects.  I've used it in a few of my projects and > its quite handy. > > http://blog.awarelabs.com/?p=29 > > -Paul > > On Mar 13, 12:13 pm,

Re: pagination problem with "Next" and saving results as a dictionary

2009-03-13 Thread pkenjora
Uhm maybe this post will help its a tag that handles the pagination on query objects. I've used it in a few of my projects and its quite handy. http://blog.awarelabs.com/?p=29 -Paul On Mar 13, 12:13 pm, Jesse wrote: > Hello Micah, > > I can get the q with GET, but I have t

Re: pagination problem with "Next" and saving results as a dictionary

2009-03-13 Thread Jesse
Hello Micah, I can get the q with GET, but I have too complicated of a search and I need to use POST. I'm having much difficulty with my template code with POST to work with paginator. I'll keep trying. Thanks for your patience and help. --~--~-~--~~~---~--~~

Re: efficient Pagination of large queryset

2009-03-13 Thread Malcolm Tredinnick
On Thu, 2009-03-12 at 18:57 -0700, adrian wrote: > > I have users with 30K rows in the database and have to support various > types of queries, some of which > require raw SQL. I used a two-step approach to get the query_set, > first do a raw SQL query to get a list of the ids of the rows I nee

efficient Pagination of large queryset

2009-03-12 Thread adrian
I have users with 30K rows in the database and have to support various types of queries, some of which require raw SQL. I used a two-step approach to get the query_set, first do a raw SQL query to get a list of the ids of the rows I need, then filter the queryset with it. This isn't terribly f

Re: pagination problem with "Next" and saving results as a dictionary

2009-03-12 Thread Micah Ransdell
Jesse, You need to change your code in the view to look at the GET parameter rather than POST. Change this line: query = request.POST['q'] to: query = request.GET['q'] Also, make sure when you are submitting to your search page that you are submitting the page with GET in the method of your fo

Re: pagination problem with "Next" and saving results as a dictionary

2009-03-12 Thread Jesse
Hello Micah, I tried this in the template: next The browser URL is: http://127.0.0.1:8000/Search/?q=?&page=2 and this in the template: next The browser URL is: http://127.0.0.1:8000/Search/?q=harris&page=2, which is correct for q, but the error for both is still: Request Method: GE

Re: pagination problem with "Next" and saving results as a dictionary

2009-03-12 Thread Jesse
rieve with a new view and use that view for the pagination. I can see that the pagination works better with a simple retrieval. Can you tell me how to create a new object from "list" that can be retrieved in a new view? Thanks. On Mar 11, 10:20 pm, Micah Ransdell wrote: > Jesse, &g

Re: pagination problem with "Next" and saving results as a dictionary

2009-03-11 Thread Micah Ransdell
Jesse, The error you are getting is from "q" not being in your post QueryDictionary. This happens because when you click next you are not rePOSTing the q variable. Either you can put the q variable into an input box and POST it again by making your next link a submit button, or you could change q

pagination problem with "Next" and saving results as a dictionary

2009-03-11 Thread Jesse
The following code is for a search on q and attaches tuples from the search on another model. The search results are appended together to create the final data results "list". def Bypub(request): query = request.POST['q'] if query: qset = ( Q(pubtitlestrip__icontains=q

Databrowse pagination

2009-02-25 Thread saeb
My admin webpage gets stuck and often fails on large database when I use Databrowse. I think it needs pagination, is there a way to get around this? I really like the Databrowse feature as a read-only tool, it would be great if someone helps me out in this issue. Thanks, saeb

Re: Django CMS and template tags (is it a problem with pagination mechanism?)

2009-02-22 Thread Theme Park Photo, LLC
No! It was the fact that you really need all the stuff that's on the sample template On Feb 22, 2:29 pm, Donn wrote: > On Sunday, 22 February 2009 21:00:24 Theme Park Photo, LLC wrote: > > {% block content %} > > Hello > > {% end block %} > > It's not this extra space between end and block i

Re: Django CMS and template tags (is it a problem with pagination mechanism?)

2009-02-22 Thread Donn
On Sunday, 22 February 2009 21:00:24 Theme Park Photo, LLC wrote: > {% block content %} > Hello > {% end block %} It's not this extra space between end and block is it? \d -- Where I web: http://otherwise.relics.co.za/ Comics, tutorials, software and sundry --~--~-~--~~

Django CMS and template tags (is it a problem with pagination mechanism?)

2009-02-22 Thread Theme Park Photo, LLC
block content %} Hello {% end block %} All I see when I render the page (go to the URL based on the slug I entered in django-cms) is FOO I think it has to do with the pagination template tags it's wrapping around my content before handing it off to the templat

Re: Pagination Suggestions

2008-12-26 Thread Dana
I highly recommend: http://code.google.com/p/django-pagination/ Very easy to implement, requires no modifications to views or models, purely template based (via template tags). On Dec 24, 2:36 pm, kev wrote: > Ah ok :) > > Thx!! > > On Dec 24, 5:12 pm, Brian Neal wrote: > &

Re: Pagination Suggestions

2008-12-24 Thread kev
Ah ok :) Thx!! On Dec 24, 5:12 pm, Brian Neal wrote: > On Dec 24, 3:54 pm, kev wrote: > > > Hello, > > Im trying to create a digg type pagination. Is there a decent > > pagination app already out there that works for 1.0? I tried looking > > but havent succeeded.

Re: Pagination Suggestions

2008-12-24 Thread Brian Neal
On Dec 24, 3:54 pm, kev wrote: > Hello, > Im trying to create a digg type pagination. Is there a decent > pagination app already out there that works for 1.0? I tried looking > but havent succeeded. > > Thanks, > Kev I'm using this. Works great! http://www.djang

Pagination Suggestions

2008-12-24 Thread kev
Hello, Im trying to create a digg type pagination. Is there a decent pagination app already out there that works for 1.0? I tried looking but havent succeeded. Thanks, Kev --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Pagination of non-Django database

2008-11-26 Thread huw_at1
1 schrieb:> A small part of my framework > queries a non-Django db due to it being a > > legacy db with primary keys already in use. My question is is there a > > recognised way of applying pagination to non-Django db objects such > > that I can paginate the sql select que

Re: Pagination of non-Django database

2008-11-26 Thread Thomas Kerpe
Am 26.11.2008 13:19 Uhr, huw_at1 schrieb: > A small part of my framework queries a non-Django db due to it being a > legacy db with primary keys already in use. My question is is there a > recognised way of applying pagination to non-Django db objects such > that I can paginate th

Pagination of non-Django database

2008-11-26 Thread huw_at1
Hey all, A small part of my framework queries a non-Django db due to it being a legacy db with primary keys already in use. My question is is there a recognised way of applying pagination to non-Django db objects such that I can paginate the sql select query on this database? Many thanks

Re: pagination best practices

2008-08-23 Thread Juan Hernandez
Yep, thank you very much jhv On Mon, Aug 25, 2008 at 1:09 AM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Sun, Aug 24, 2008 at 1:23 AM, Juan Hernandez <[EMAIL PROTECTED]>wrote: > >> >> So, let's say that everytime i get a page, the internat query to the db >> just gets the, lets say, 10 rows th

Re: pagination best practices

2008-08-23 Thread Juan Hernandez
I think I get it... domains = g.objects.all() just makes the QuerySet and paginator = ObjectPaginator(domains, 10) executes the query limiting the records to the one requested... Excellent Thanks for your help jhv On Mon, Aug 25, 2008 at 12:53 AM, Juan Hernandez <[EMAIL PROTECTED]>wrote: > >>

Re: pagination best practices

2008-08-23 Thread Karen Tracey
On Sun, Aug 24, 2008 at 1:23 AM, Juan Hernandez <[EMAIL PROTECTED]>wrote: > > So, let's say that everytime i get a page, the internat query to the db > just gets the, lets say, 10 rows that I requested? because I'm using > objects.all(). In that process, where is the DB being hit? > > Model.object

Re: pagination best practices

2008-08-23 Thread Juan Hernandez
> > > Using the Pagniator makes it so that when you hit the DB, the retrieved > results are limited to those relevant for the page you are displaying. You > are not reading the whole table and then tossing away everything except what > is on the page your are displaying, you are only reading from

Re: pagination best practices

2008-08-23 Thread Karen Tracey
On Fri, Aug 22, 2008 at 8:05 PM, Juan Hernandez <[EMAIL PROTECTED]>wrote: > I have this very simple and primitive pagination method being called with > this instruction in urls.py > > [snipped] > Every time I hit something like domain/pyisp/menu/2 it shows the second &

Re: pagination best practices

2008-08-23 Thread Juan Hernandez
any suggestions?? hehehe On Sat, Aug 23, 2008 at 7:35 PM, Juan Hernandez <[EMAIL PROTECTED]>wrote: > I have this very simple and primitive pagination method being called with > this instruction in urls.py > > ### > (r'^pyisp/menu/(\d+)/$', 'mail.views.me

pagination best practices

2008-08-22 Thread Juan Hernandez
I have this very simple and primitive pagination method being called with this instruction in urls.py ### (r'^pyisp/menu/(\d+)/$', 'mail.views.menuPaginator'), ### This is the method ### def menuPaginator(request, number): domains = g.objects.all() paginator = Obj

Re: Need help with some custom pagination

2008-07-25 Thread [EMAIL PROTECTED]
t; wrote: > > > On a forum I'm working on (http://grassrootsmotorsports.com/forum/) > > the topic lists have pagination, but each topic also shows how many > > pages it has. > > > I'm currently using a "range" filter I found, which takes the topic > > p

Re: Search Result Pagination

2008-05-15 Thread Michael Ellis
Adi. That got the pagination working on the first page! Thank you! I'm getting no results on page 2, however. I know this is in the way I'm handling GET requests (see the 'else' statement). I'm just not sure how this should be handled. I'll be reading some d

Re: Search Result Pagination

2008-05-15 Thread Adi J. Sieker
Michael Ellis wrote: >> What does the search funtion return? >> A django queryset or a xapian result and are you sure that >> the Paginator can handle the returned value? > > Hmmm. Great question. > > I believe it's returning a xapian result set. > > In my template, I'm looping through the pagi

Re: Search Result Pagination

2008-05-14 Thread Michael Ellis
> What does the search funtion return? > A django queryset or a xapian result and are you sure that > the Paginator can handle the returned value? Hmmm. Great question. I believe it's returning a xapian result set. In my template, I'm looping through the paginator.object_list. Here's a simple e

Re: Search Result Pagination

2008-05-14 Thread Adi J. Sieker
Michael Ellis wrote: >> what does the search method of your model do? >> I can't find any reference of a search function in the docs. > > I'm sorry, but I don't think I understand the question. > > I'm searching on a full-text index. > What does the search funtion return? A django queryset or

Re: Search Result Pagination

2008-05-14 Thread Michael Ellis
> what does the search method of your model do? > I can't find any reference of a search function in the docs. I'm sorry, but I don't think I understand the question. I'm searching on a full-text index. ME --~--~-~--~~~---~--~~ You received this message because y

Re: Search Result Pagination

2008-05-14 Thread Adi Jörg Sieker
Hi, what does the search method of your model do? I can't find any reference of a search function in the docs. adi On 14.05.2008, at 22:26, Michael Ellis wrote: > > You're right. The form action was blank. I changed it to "/Catalog/ > search/?page=1". I'm now seeing the page parameter, but I'm

Re: Search Result Pagination

2008-05-14 Thread Michael Ellis
You're right. The form action was blank. I changed it to "/Catalog/ search/?page=1". I'm now seeing the page parameter, but I'm still seeing all the results on one page. >> Have you tried 'results': results.object_list in your render_to_response? I tried this and still no luck. Also, using "'re

Re: Search Result Pagination

2008-05-14 Thread Adi Jörg Sieker
Hi, the query parameter page=1 probably won't be there when you submit the search form. I 'd guess your forms action parameter is either empty or set to the url of your search view. Have you tried 'results': results.object_list in your render_to_response? regards adi On 14.05.2008, at

Re: Search Result Pagination

2008-05-14 Thread Michael Ellis
> shouldn't this be > results = paginator.page(pager).object_list Thanks, Adi. I get the same result set with that. The only exception is that I get the following error: 'generator' object has no attribute 'has_next' If I comment out the 'has_next' and 'has_previous' lines in the render

Re: Search Result Pagination

2008-05-14 Thread Adi Jörg Sieker
Hi, On 14.05.2008, at 00:47, Michael Ellis wrote: > results = paginator.page(pager) shouldn't this be results = paginator.page(pager).object_list see http://www.djangoproject.com/documentation/pagination/ adi -- Adi J. Sieker mobile: +49 - 178 -

Search Result Pagination

2008-05-13 Thread Michael Ellis
Hello all. I'm having trouble getting pagination working on search results in a custom view. I have djapian/xapian full-text indexing working and I have some pagination code cobbled together from various sources. I can get the search results and all the pagination (result count, page x of y

Re: Pagination: how to find out on what page a give object will end up

2008-05-09 Thread Juanjo Conti
VidJa Hunter escribió: > > paginator.is_on_page(object) would return page 6 if object is element 31 of > the given queryset. > I am leaving right now, but, what about something like this? for page in paginator.page_range: if object in paginator.page(page).object_list: r

Pagination: how to find out on what page a give object will end up

2008-05-09 Thread VidJa Hunter
6. When a user jumps from page X to Y I would like to keep the pagination structure intact such that the user may paginate back and forth between page 1 and 6 to see what is in between. Basically this boils down to the following question: how to find out what the page number would be of specific obje

pagination

2008-04-09 Thread Jared
g the object_detail generic view to display "x" objects. I would like to also display a list of related "y" objects. I know I can do this via y_set.all no problem with that. My question is - is it possible to use the object_detail generic view and get pagination for the related y objects?

Search Page with Pagination, why do I need to refresh the page to see updated results?

2008-02-03 Thread boralyl
I'm using django and I have a search page that uses pagination. All works well, but if I change the search term the first page is fine, but if I go to the 2nd page I see results from the previous search. I must manually reload the page to see the 2nd page for the new search term. Is

Re: The last records of table by using of Pagination

2008-01-11 Thread shabda
instead of q_list = ObjectPaginator(Queue.objects.all(), 20) Provide a order_by, if you would like them to be in descending order, in order when they were created have, q_list = ObjectPaginator(Queue.objects.all().order_by('-id'), 20) Or better yet have a created_on field in the model, w

The last records of table by using of Pagination

2008-01-11 Thread Nader
Hello, I use a view in an application with which I can present the 20 pages of a table at once. from queues.models import Queue def list(request, page=0, message=" "): page = int(page) q_list = ObjectPaginator(Queue.objects.all(), 20) has_previous = q_list.has_previous_page(page)

Re: An easier way to do this Pagination in a template?

2008-01-10 Thread Prof. William Battersea
Ahh. I eventually did write an inclusion tag. I see I could have saved myself some time, but it was nice to learn how to do it. Thanks! On Jan 10, 2008 9:53 AM, Paul Childs <[EMAIL PROTECTED]> wrote: > > Take a look here too... > > http://code.djangoproject.com/wiki/PaginatorTag > > > --~--~---

<    1   2   3   4   >