The problem appears to be because you are using a numeric key as field
name.
change this: field_id = t['id'] to field_id = str(t['id']) , or
use a real string as the name.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
I didn't examine your code but I suggest using form_for_instance or
form_for_model to generate a dynamic form from a django app model.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
Hi,
I have built this class:
class FormClass(forms.Form):
def __init__(self, *args, **kwargs):
super(FormClass, self).__init__(*args, **kwargs)
# Get tags and their id
for t in Item.objects.get(pk=id).tags.values():
field_id = t['id'] # tag ID is the form's field
3 matches
Mail list logo