Code

Opened 7 years ago

Closed 7 years ago

#3898 closed (wontfix)

reinstate the model field type css classes to form elements generated with newforms' as_* methods.

Reported by: mrmachine Owned by: nobody
Component: Forms Version: master
Severity: Keywords: newforms oldforms model css classes form_for_model form_for_instance
Cc: real.human@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

i'd like to see the model field type classes from oldforms (vIntegerField, vEmailField, vPasswordField, etc) re-applied to form elements generated by newforms' as_* methods. these were great as they allowed differently sized field elements depending on the data type. e.g. you might want an input text tag for an email address to be wider than an input text tag for an integer or a date.

if people don't want to make use of these, they can ignore them, but i don't see the harm in having them in there as hooks besides a few bytes in html size, especially for the as_* methods. if that's a problem, they could be switched on or off in settings.py or when the form.as_* and field.as_* methods are called. not having these hooks appears to be a fairly significant departure from the oldforms functionality, so i'd like to see them reinstated if there are no major objections.

Attachments (0)

Change History (4)

comment:1 Changed 7 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

Adrian?

comment:2 Changed 7 years ago by Gary Wilson <gary.wilson@…>

  • Resolution set to duplicate
  • Status changed from new to closed

duplicate of #3686.

comment:3 Changed 7 years ago by Gary Wilson <gary.wilson@…>

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Sorry, it must be getting late. This is no duplicate.

comment:4 Changed 7 years ago by adrian

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

Eh, I removed this because it seemed magical to add framework-specific stuff in the output. You can always create your own widgets that add those attributes.

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.