[patch] textfield rendered as textarea
|Reported by:||Philipp Keller <philipp.keller@…>||Owned by:||adrian|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
- 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
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.
Change History (3)
comment:1 Changed 8 years ago by Philipp Keller <philipp.keller@…>
- Summary changed from [patch] enhancements in models.py / textfield rendered as textarea to [patch] textfield rendered as textarea
- Type changed from enhancement to defect