views:

2010

answers:

1

I'm using something like this in my template

<select multiple="multiple"  name="services" id="services" size="5">
    {% for service in services %}
     <option value="{{service.id}}">{{service}}</option>
    {% endfor %}
</select>

When I view the POST data in Firebug or the Django debug, I see it only sends one value. Am I doing something wrong or misunderstanding a concept?

+13  A: 
request.POST.getlist('services')
Ignacio Vazquez-Abrams
Jackpot! I think I _did_ need to change services to services[], but getlist r0xors for this. I thought I'd scoured the Django docs but apparently, I was wrong.
neoice
You don't need the []. That's a convention limited to PHP.
bobince