formfields.SelectField doesn't select correct value for ForeignKey
|Reported by:||Maniac <Maniac@…>||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
formfields.SelectField renders withou "selected" attribute set to the correct option. This happens because FormWrapper fetches 'data' for SelectField.render() by its field_name. However most of the times real data for the field is stored in form's dict under field_name+'_id' key.
This effectively breaks every form with the ForeignKey generated by generic view 'update_object' or with Manipulators as described in docs at http://www.djangoproject.com/documentation/forms/