Code

Opened 7 years ago

Closed 2 years ago

#3286 closed enhancement (wontfix)

[design-q] Please add newforms as_div() method for printing forms.

Reported by: brooks.travis@… Owned by: adrian
Component: Forms Version: master
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the hope of maintaining slightly greater semantic purity in the output forms, you may want to consider allowing priting of forms as <div>s in addition to <p>, <ul>, and <tr>.

Attachments (3)

forms.py.diff (671 bytes) - added by Jannis <jl@…> 7 years ago.
Additional as_div method in forms.py
tests.py.diff (10.0 KB) - added by Jannis <jl@…> 7 years ago.
tests and docs for new as_div()
tests2.py.diff (10.0 KB) - added by Jannis <jl@…> 7 years ago.
revision of tests and docs for new as_div()

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by Jannis <jl@…>

Additional as_div method in forms.py

Changed 7 years ago by Jannis <jl@…>

tests and docs for new as_div()

Changed 7 years ago by Jannis <jl@…>

revision of tests and docs for new as_div()

comment:1 Changed 7 years ago by ubernostrum

From the last couple times these sorts of things have been suggested (for example, with an as_dl method), it's been pointed out that these methods are meant to be quick conveniences; newforms will let you write your template any way you want, and the various as_* methods are meant to be few in number, with fine-grained control delegated to templates.

comment:2 Changed 7 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed
  • Summary changed from Please add newforms as_div() method for printing forms. to [design-q] Please add newforms as_div() method for printing forms.

Closing as wontfix for the same reason pointed out in #3108.

comment:3 Changed 2 years ago by anonymous

  • Easy pickings unset
  • Resolution wontfix deleted
  • Status changed from closed to reopened
  • UI/UX unset

5 years have passed div's a heavily used for pages styling. Please, reconsider of fixing this.

comment:4 Changed 2 years ago by carljm

  • Resolution set to wontfix
  • Status changed from reopened to closed

Please don't reopen tickets closed wontfix by a core developer - if you want to discuss the issue, bring it up on the django-developers mailing list for discussion.

The prevalence (or not) of div-based layouts is irrelevant to the reasons given for closing this as wontfix. The "as_*" methods are a quick and inflexible development shortcut; if anything they should be phased out entirely in favor of template-based rendering, certainly not expanded.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.