Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create_buttons(*buttons):
- radio_fields = []
- for button_name, button_choices in buttons:
- field = RadioField(button_name, choices=button_choices)
- radio_fields.append(field)
- return radio_fields
- buttons_data = [
- # (button_name, button_choices)
- ('button1', [('name1', 'val'), ('name2', 'val')]),
- ('button2', [('name1', 'val'), ('name2', 'val')]),
- ('button3', [('name1', 'val'), ('name2', 'val')]),
- ]
- buttons = create_buttons(buttons_data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement