If I'm instantiating a form, how do I set a ChoiceField value in it?

I have a form with an attribute "role" which I am setting to the
user's current role, like so:

form = EditUserForm({
  'last_name': user.last_name,
  'first_name': user.first_name,
  'email': user.email,
  'role': user.get_profile().role,
  'client': user.get_profile().client.id
})

I output the form with form.as_p, but the corresponding <select>
option is not selected. What do I need to do for it to be selected?

Thomas

-- 
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