#25679: ModelForm.Meta.fields and exclude are not honoured for custom fields ---------------------------+-------------------------------------- Reporter: tino | Owner: nobody Type: Bug | Status: new Component: Forms | Version: master Severity: Normal | Resolution: Keywords: modelform | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 ---------------------------+-------------------------------------- Changes (by hramezani):
* needs_docs: => 0 * needs_tests: => 0 * needs_better_patch: => 1 Comment: The reason is these lines of code in `class ModelFormMetaclass` in `django/forms/models.py` file: {{{ #!python # Override default model fields with any custom declared ones # (plus, include all the other declared fields). fields.update(new_class.declared_fields) }}} I Attached a patch and also i create a pull request to fix this bug. -- Ticket URL: <https://code.djangoproject.com/ticket/25679#comment:1> 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/062.1fddbf0f13a4920c5d37a2d1193c0500%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.