> From: mono
> Sent: Thursday, 18 December 2008 22:10
> To: Django users
> Subject: Re: how to add more params in url
> 
> 
> I don't know whether it is a good answer because only two 
> page links is here and the aim of is_extend flag is to show 
> entire or part of columns.
> 
> so I could not tell a page linkto 
> is_extend=shrink&page=next_page and 
> is_extend=shrink&page=previous_page
> 
> maybe I need more page links, like the first, the last ,or 
> some exactly page number, maybe I need more params like asp 
> or jsp, I hope to how to django dispatch the url with more 
> than one param.

I'm not sure quite what you're wanting to do here or what your problem
is.

The whole idea of query parameters - those things after the '?' symbol
in key=value pairs - is that they're optional to the page.  You don't
need to recognise these in your URL, so they don't need to be named
arguments to your view.  You can simply say (e.g.):

if 'is_extend' in request.GET:
        is_extend = request.GET['is_extend']
        if is_extend == 'shrink':
                # shrink the page
        elif is_extend == 'expand':
                # expand the page

Then you have a similar piece of code to handle the 'page' parameter and
so forth.

IMO you shouldn't have too many parameters in the path part of the URL -
the bit before any '?'.

Hope this helps,

--
Paul Wayper
SYSTEMS ENGINEER
TransACT

Telephone: 02 6229 8026
Mobile: 0422 392 081

PO Box 1006, Civic Square  ACT  2608

www.transact.com.au

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to