Opened 16 years ago

Closed 14 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)

make_radioselect_iterable.diff (3.3 KB ) - added by oyvind 16 years ago.
make_radioselect_iterable2.diff (3.7 KB ) - added by J. Pablo Fernández <pupeno@…> 16 years ago.
This patch solves the issue in my last comment and also ads value indexing.

Download all attachments as: .zip

Change History (9)

by oyvind, 16 years ago

comment:1 by J. Pablo Fernández <pupeno@…>, 16 years ago

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 i

where are the initial widget and attrs supposed to come from?

by J. Pablo Fernández <pupeno@…>, 16 years ago

This patch solves the issue in my last comment and also ads value indexing.

comment:2 by Jacob, 16 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Jacob, 16 years ago

Needs documentation: set

comment:4 by Collin Anderson, 16 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 Collin Anderson, 16 years ago

Cc: cmawebsite@… added

comment:6 by , 15 years ago

Cc: amlau@… added

comment:7 by Chris Beaven, 14 years ago

Resolution: duplicate
Status: newclosed

Marking as a dupe of the more recently patched in #9230

Note: See TracTickets for help on using tickets.
Back to Top