A "choices" value should be a tuple or list containing two-value tuple or list 
containing the key and value for each dropdown option.

Other issues with the code you originally posted:

1. What looked like a context (that dictionary containing "polls"), was being 
passed to the creation of a form, but then the template attempted to access the 
'polls' object, which wouldn't exist there because it was never sent in the 
context passed to render_to_respone.

2. A form was being used, not a model form.

3. All polls were pulled from the model, but only one form was created. 

4. Even if multiple forms were created, it still wouldn't work because a list 
of models were being passed to the form instead of just one at a time (to 
create multiple forms).

5. Even if #4 was done correctly, it was being sent as the 'data' kwarg and not 
the 'instance' kwarg.

6. Even if all the rest was correct it still wouldn't have worked because it 
was a form instead of a model form in the first place.

Those reasons are why I suggested you go through the tutorial, because the code 
you posted is pretty much completely wrong. I was trying to be nice and not 
point out that it was hopelessly broken by suggesting you do the tutorial -- 
not just read it. It is kind of dated, but you'll see the manipulation of model 
instances within a template on part three, which you need because your {{ polls 
}} won't do what you want it to do.

Then, see the modelforms documentation which I linked to last time, and will 
again here:
http://docs.djangoproject.com/en/1.2/topics/forms/modelforms/

I agree that the tutorial isn't comprehensive, and feel free to reply if you 
get stuck. It's just that it's a lot easier to help you if you're doing the 
right thing the wrong way instead of a big pile of wrong.

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to