Opened 17 years ago

Closed 17 years ago

#3267 closed defect (fixed)

[patch] textfield rendered as textarea

Reported by: Philipp Keller <philipp.keller@…> Owned by: Adrian Holovaty
Component: Forms Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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 (1)

newforms_textfield_rendered_as_textarea.diff (717 bytes ) - added by Philipp Keller <philipp.keller@…> 17 years ago.
Exists only the "textfield rendered as textarea" part, forget the diff above

Download all attachments as: .zip

Change History (3)

comment:1 by Philipp Keller <philipp.keller@…>, 17 years ago

Summary: [patch] enhancements in models.py / textfield rendered as textarea[patch] textfield rendered as textarea
Type: enhancementdefect
  • modelfield.editable already handled by Ticket 3247
  • foreignkey-bugfix already handled by Ticket 3257
  • textfield rendered as textarea still open, see new posted diff

by Philipp Keller <philipp.keller@…>, 17 years ago

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

comment:2 by Adrian Holovaty, 17 years ago

Resolution: fixed
Status: newclosed

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

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