#36986: Add a hook to Serializer._value_from_field() for complex fields like
CompositePrimaryKey
-------------------------------------+-------------------------------------
Reporter: Tim Graham | Owner: Vishy
Type: | Algo
Cleanup/optimization | Status: assigned
Component: Core | Version: dev
(Serialization) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham):
The registration approach might be overcomplicated. In my
[https://github.com/mongodb-forks/django/pull/18 latest approach], I added
`Field.serialize_to_python()` and `deserialize_from_python()` hooks.
That's enough for MongoDB's embedded model fields and plays nicely with
composite fields as well. You could see if similar hooks for the XML
serializer would allow cleaning up the JSONField-specific code there.
--
Ticket URL: <https://code.djangoproject.com/ticket/36986#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 visit
https://groups.google.com/d/msgid/django-updates/0107019d31f0c70a-f501a052-ab9a-4595-b377-163e3785518d-000000%40eu-central-1.amazonses.com.