You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was recently working with django.core.serializers.python module. It implements both serializer and deserializer classes that enable export/import the Django ORM objects into/from "Python objects". Such an object is actually as dict with a hard-coded set of keys: model (lower-case model label, str), pk (the actual object's database PK value) and fields (a dict with fields names mapped onto their serialized values). Currently, the objects are annotated by dict[str, Any].
If one considered adding some wrappers around the mentioned classes (those in django.core.serializers.json are examples) from django.core.serializers.python, it would be nice to have those "objects" fully annotated, e.g. using TypedDict, something like:
I was recently working with
django.core.serializers.python
module. It implements both serializer and deserializer classes that enable export/import the Django ORM objects into/from "Python objects". Such an object is actually asdict
with a hard-coded set of keys:model
(lower-case model label,str
),pk
(the actual object's database PK value) andfields
(adict
with fields names mapped onto their serialized values). Currently, the objects are annotated bydict[str, Any]
.If one considered adding some wrappers around the mentioned classes (those in
django.core.serializers.json
are examples) fromdjango.core.serializers.python
, it would be nice to have those "objects" fully annotated, e.g. usingTypedDict
, something like:I hope you will find this idea interesting.
Anyway, I thank all the developers and maintainers of the projects. This is truly a great job done! ❤️
The text was updated successfully, but these errors were encountered: