#12238: ModelAdmin ignores dynamic fields of ModelForm
-------------------------------------+-------------------------------------
     Reporter:  anonymous            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.admin        |                  Version:  1.1
     Severity:  Normal               |               Resolution:
     Keywords:  modelform            |             Triage Stage:  Accepted
  modeladmin dynamic field           |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by François Freitag):

 >  6. Update !ModelForm's `Meta.fields` to include "xyz"

 This step leaves the `Meta.fields` modified, because the `Meta` is only
 instantiated when the `ModelForm` class is constructed. Thus, on the next
 request, "xyz" will still be part of the `Meta.fields`. In my use case,
 the field was added conditionally, and was unexpectedly present in the
 `Meta.fields` on the next request.

 This might be a pitfall for others.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/12238#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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018028bca23b-c3510c20-b290-4ffb-ba66-c1303d720033-000000%40eu-central-1.amazonses.com.

Reply via email to