Opened 15 years ago

Closed 14 years ago

#12074 closed (fixed)

Added as_p and as_ul output for formsets.

Reported by: Arthur Debert Owned by: nobody
Component: Forms Version: dev
Severity: Keywords: formset template
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently a form can be rendered to html as tables, paragraphs and lists. Formsets can only be rendered to tables.

It's not a big deal, but the assymetry is confusing. The first thing I ever did with a formset was to use {{formset.as_p}} in a template, and get a blank output.
If there's a good reason not to allow for as_p and as_u for formsets, maybe the documentation should mention it.

Attachments (3)

django-formset-as_p-as_ul.diff (988 bytes ) - added by Arthur Debert 15 years ago.
formset-as_p-as_ul-with-tests.patch (3.1 KB ) - added by David Novakovic 14 years ago.
formset-as_p-as_ul-with-unittests.patch (3.9 KB ) - added by David Novakovic 14 years ago.

Download all attachments as: .zip

Change History (8)

by Arthur Debert, 15 years ago

comment:1 by Russell Keith-Magee, 15 years ago

Needs tests: set
Triage Stage: UnreviewedAccepted

comment:2 by gijs, 14 years ago

line 306 in the patch includes 'form.as_table()' - 'this should be form.as_p()'

comment:3 by David Novakovic, 14 years ago

Needs tests: unset

Howdy,

Find attached a patch with as_table in as_p changed to as_p (as noted by @gijs).

The patch also contains doctests for as_table, as_p and as_ul.

Cheers.

by David Novakovic, 14 years ago

by David Novakovic, 14 years ago

comment:4 by Alex Gaynor, 14 years ago

Triage Stage: AcceptedReady for checkin

Looks good to me.

comment:5 by Honza Král, 14 years ago

Resolution: fixed
Status: newclosed

(In [14250]) Fixed #12074 -- Adding .as_p and as_ul methods to FormSet. Thanks arthurdebert and dpn for the patch.

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