On Mon, Oct 4, 2010 at 3:20 PM, Tonton <[email protected]> wrote:
> hello
>
> i use this form to have a choice list and change to another on select
> <p >
> <form action="/cartes/" method='GET'>
> <select name="" onchange="this.form.submit()">
> <option value={{carte.id}}>{{carte.titre}}</option>
> {% for carte in latest_carte_list %}
> <option value={{carte.id}}>{{carte.titre}}</option>
> {% endfor %}
> </select>
> </p>
>
> and it is return a url like http://mywebsite/cartes/?=id
>
> This is my urls line to use http://mywebsite/cartes/id what i want to
> have
>
> (r'^(?P<carte_id>\d+)', 'suivix'),
>
> and it is not working great :o(
>
> so i don't know what to write in my form to have /cartes/id or in my
> urls.py file to translate /cartes/?=id in /cartes/id ?
>
> Thanks for your help
>
> Tonton
>
>
>
Hello
yes my question have no response
so i change my form method to POST and use a name carte_id
I change ma action in views.py
and i test the method
if request.method == 'GET':
do_something() (that works with /cartes/ )
elif request.method == 'POST':
do_something_else() (that works with my form !)
and i use the name of my form cid=request.REQUEST["carte_id"])
so it is solve
thanks
tonton
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.