Hi,
I'm building an application on app Engine and I want to make a form field with multiple choices.
Here is my form (it uses django.newforms from the app engine sdk (django 0.96)) :
from google.appengine.ext.db import djangoforms
from django import newforms
class KeywordForm(djangoforms.ModelForm):
class Meta:
model = Keyword
exclude = ['site', 'created_at', 'last_update']
choices = [ (1, 'value1'), (2, 'value2'), (3, 'value3'), (4, 'value4') ]
server = newforms.fields.MultipleChoiceField(choices = choices)
The problem is : when I submit the form (with one or more values selected) I've this validation error : "Enter a list of values."
I don't understand why... some help on this problem will be very appreciated.
Thanks ! :)
Edit (extra informations) :
Here is the form validation code :
form = forms.KeywordForm(data=self.request.POST)
if form.is_valid():
...
self.request.POST :
UnicodeMultiDict([(u'keyword', u'test'), (u'server[]', u'1'), (u'server[]', u'2')])