ForeignKey relation doesn't work with newforms form_for_model() save
|Reported by:||Jure Cuhalev <gandalf@…>||Owned by:||adrian|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When having a model with ForeignKey(), clean_data returns unicoded integer of related-field, but django expects an instance of that model. Because of that model_save in newforms/models.py line 18, obj = self._model(self.clean_data) fails.
The solution is probably to resolve ForeignKey somewhere before but I'm not sure how to do this properly.
Change History (4)
comment:1 follow-up: ↓ 2 Changed 7 years ago by mir@…
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset