Django

Code

Ticket #3267 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

[patch] textfield rendered as textarea

Reported by: Philipp Keller <philipp.keller@gmail.com> Assigned to: adrian
Milestone: Component: Forms
Version: SVN Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

enhancements:

  • models.py takes modelfield.editable into account (fields with editable=false are not drawn and not considered during model/instance to form transformation)
  • a textfields default widget is now widgets.Textarea

bugfix: When tranforming a model with a foreignkey field named "category" into a form with form_for_model/form_for_instance, posting that form, populating the posted data into this form and finally hitting save() on that form instance, the foreignfield won't be saved into db as in field "category" now is a unicode string, not a Category-Instance: "Invalid value: 'category' should be a <class 'icoc.extranet.models.Category'> instance, not a <type 'unicode'>". I fixed this in mapping the column names to the db column names. Though I'm not sure if this is at the right point of the process.

I ensured all the tests succeed.

Attachments

newforms_textfield_rendered_as_textarea.diff (0.7 kB) - added by Philipp Keller <philipp.keller@gmail.com> on 01/10/07 04:45:41.
Exists only the "textfield rendered as textarea" part, forget the diff above

Change History

01/10/07 04:41:59 changed by Philipp Keller <philipp.keller@gmail.com>

  • type changed from enhancement to defect.
  • summary changed from [patch] enhancements in models.py / textfield rendered as textarea to [patch] textfield rendered as textarea.
  • modelfield.editable already handled by Ticket 3247
  • foreignkey-bugfix already handled by Ticket 3257
  • textfield rendered as textarea still open, see new posted diff

01/10/07 04:45:41 changed by Philipp Keller <philipp.keller@gmail.com>

  • attachment newforms_textfield_rendered_as_textarea.diff added.

Exists only the "textfield rendered as textarea" part, forget the diff above

01/10/07 17:34:37 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [4305]) Fixed #3267 -- newforms: Changed database TextField? to render as Textarea in form_for_model() forms. Thanks for the patch, Philipp Keller


Add/Change #3267 ([patch] textfield rendered as textarea)




Change Properties
Action