#36070: clean_fields(exclude=["pk"]) not implemented for composite primary keys
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  (none)
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  needsinfo
     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 Jacob Walls):

 This might be a nothing, but the doc explains that a "virtual field" is
 "excluded from model forms" and "does not have a form field", but it
 doesn't tell me what impact there is on model validation, forms aside.
 "Virtual field" isn't described elsewhere in the docs, so for me I didn't
 follow that it couldn't be passed to `exclude=`.

 A model with composite pk's looks like it has a model field called `pk`,
 so the idea is a user might think you can pass it to `exclude_fields` and
 get every part of the `pk` excluded. From the linked doc I can't really
 tell that I can't.

 (As I'm sure you've gathered I'm just kicking the tires here. Fine to wait
 to see if this comes up in practice.)
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36070#comment:2>
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 visit 
https://groups.google.com/d/msgid/django-updates/0107019441c56ba2-3cf7a10e-7541-497f-afcb-e3b6a5788dae-000000%40eu-central-1.amazonses.com.

Reply via email to