#35367: Multi-field constraint are not correctly handled when a form has one 
field
marked as read-only
------------------------+--------------------------------------
     Reporter:  David   |                    Owner:  nobody
         Type:  Bug     |                   Status:  closed
    Component:  Forms   |                  Version:  4.2
     Severity:  Normal  |               Resolution:  wontfix
     Keywords:          |             Triage Stage:  Unreviewed
    Has patch:  0       |      Needs documentation:  0
  Needs tests:  0       |  Patch needs improvement:  0
Easy pickings:  0       |                    UI/UX:  0
------------------------+--------------------------------------
Comment (by David):

 I undestand that this may be a design choice, the part which worries me is
 that when the form creation is delegated to `ModelAdmin` this behaviour is
 masked.

 I came across this problem with an admin like:

 {{{#!python
 @admin.register(MyModel)
 class MyModelAdmin(admin.ModelAdmin):
     readonly_fields = ('field_1',)
 }}}

 My expectation was to get warned before changing the other field that the
 constraint was going to be violated rather than getting an error.

 Currently there is no warning in the admin documentation which refers to
 possible problems which may be caused by read only fields and data
 validation performed by the ORM:
 
https://docs.djangoproject.com/en/5.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.readonly_fields
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35367#comment:3>
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/0107018ec81e274b-75d65860-5115-44b2-acd6-fa613dad81df-000000%40eu-central-1.amazonses.com.

Reply via email to