Interesting solution Bill! Thanks for sharing! I'll see if I can't make that mechanism work for me...
Malcolm's response was also great in detail, and now I think I need to digest some and see how I can use it, and if there's a good generic solution for me. -joe On 5/7/07, Bill Fenner <[EMAIL PROTECTED]> wrote: > > 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 django-users@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---