I did this with an accessor function in the form class:
class NonWgStep1(forms.Form):
add_edit = forms.ChoiceField(choices=(
('add', 'Add a new entry'),
('edit', 'Modify an existing entry'),
('delete', 'Delete an existing entry'),
), widget=forms.RadioSelect)
def add_edit_fields(self):
field = self['add_edit']
return field.as_widget(field.field.widget)
Then in the template, I can use form.add_edit_fields.0, etc.
I am using this in the (probably not uncommon) case of having other
form elements that go with each radio button (e.g., "modify" has a
ChoiceField of things to modify next to it).
Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---