Opened 18 years ago
Closed 16 years ago
#6458 closed (duplicate)
Make BoundField with RadioSelect widget iterable
| Reported by: | oyvind | Owned by: | nobody |
|---|---|---|---|
| Component: | Forms | Version: | dev |
| Severity: | Keywords: | newforms radioselect boudfield | |
| Cc: | cmawebsite@…, amlau@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | yes |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Would allow
{{ form.boundradiofield.0.choice_label }} {{ form.boundradiofield.0.tag }} possible in the tamplate
See tests for example
Attachments (2)
Change History (9)
by , 18 years ago
| Attachment: | make_radioselect_iterable.diff added |
|---|
comment:1 by , 18 years ago
by , 18 years ago
| Attachment: | make_radioselect_iterable2.diff added |
|---|
This patch solves the issue in my last comment and also ads value indexing.
comment:2 by , 17 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 17 years ago
| Needs documentation: | set |
|---|
comment:4 by , 17 years ago
This is somewhat of a separate issue, but I would like to see a boundfield.get_data() method and a separate bountfield.get_widget_and_attrs() method.
comment:5 by , 17 years ago
| Cc: | added |
|---|
comment:6 by , 17 years ago
| Cc: | added |
|---|
comment:7 by , 16 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Marking as a dupe of the more recently patched in #9230
Note:
See TracTickets
for help on using tickets.
Hello,
In this method:
def __iter__(self): data, attrs = self.get_data_and_attrs(widget, attrs) for i in self.field.widget.iter(self.html_name, data, attrs=attrs): yield iwhere are the initial widget and attrs supposed to come from?