#30014: Initialising disabled ModelChoiceField yields 'Select a valid choice'-error despite initialised option being valid -------------------------------------+------------------------------------- Reporter: thoha | Owner: nobody Type: Bug | Status: new Component: Forms | Version: 2.1 Severity: Normal | Resolution: Keywords: forms, disabled | Triage Stage: field, error, to_field_name | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by Etienne Chove): I think either we implement completely the **initial** paramter with a model instance (adding the 2-lines as proposed) or we do not implement at all, remove code and throw exception if user set it not as a **pk**. Leaving it work in **enabled** but not in **disabled** fields is, in my mind, a bad solution because developpers will have same issue in the future. -- Ticket URL: <https://code.djangoproject.com/ticket/30014#comment:11> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/063.64bd1c4e349da4f8a81d4c9a495398a8%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.