Re: About multiple GET params persistance between requests

2015-08-03 Thread Ryan Nowakowski
On Mon, Aug 03, 2015 at 11:49:09AM -0400, felix wrote:

> El 03/08/15 09:42, duriromp...@gmail.com escribió:

> >I'm in a point of my app where I've two GET params, *p* and *q*

> >(pagination and query search), and I think that the best method to

> >remember the params value when you change page is to use a string to

> >manually build up the params URL. Any ideas?

> >

> ListView might help or maybe its ancestor MultipleObjectMixin with its

> paginate_by attribute.



Or if you just want a good way to build up that query, I use QueryDict:



from django.http import QueryDict

qdict = QueryDict('', mutable=True)

qdict['p'] = my_page

qdict['q'] = my_query

my_new_url = "http://example.com/my-view?%s; % qdict.urlencode()

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20150803193041.GF12140%40fattuba.com.
For more options, visit https://groups.google.com/d/optout.


Re: About multiple GET params persistance between requests

2015-08-03 Thread felix

El 03/08/15 09:42, duriromp...@gmail.com escribió:
I'm in a point of my app where I've two GET params, *p* and 
*q* (pagination and query search), and I think that the best method to 
remember the params value when you change page is to use a string to 
manually build up the params URL. Any ideas?


ListView might help or maybe its ancestor MultipleObjectMixin with its 
paginate_by attribute.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/55BF8D75.5010200%40epepm.cupet.cu.
For more options, visit https://groups.google.com/d/optout.


About multiple GET params persistance between requests

2015-08-03 Thread durirompepc
I'm in a point of my app where I've two GET params, *p* and *q* (pagination 
and query search), and I think that the best method to remember the params 
value when you change page is to use a string to manually build up the 
params URL. Any ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e6fa676d-7cd2-4368-a439-ca533e5ea988%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.