1👍
You can see why it’s not valid by print errors:
def createTables(request):
if request.method == 'POST':
form = tipoAtribute(request.POST) # No need for "or None"
if form.is_valid():
....
else:
print form.errors
0👍
It doesn’t make sense to use the Select
widget with a MultipleChoiceField
. Use SelectMultiple
instead.
tipoAtributo = forms.MultipleChoiceField(choices=CHOICES, required=True, widget=forms.SelectMultiple())
- Django – display informations from different models into the same HTML template
- Model properties returning empty
- Best way to filter a django QuerySet based on value without name (rank)
Source:stackexchange.com