Skip to content

WIP: feat: Add support for defining a custom serializer

Ghost User requested to merge add-custom-serializer-support into master

I've come accross this limitation several times. I think DjangoLDP's automatic serialization system is great. But there are times when the data present in database must be a minimum processed before serialization or deserialization which raises the need for defining a custom serializing method.

An example is supporting generic likes. The model makes use of GenericForeignKey and Django's ContentType framework. But these values mean nothing as is in a federated world. There are just a DB representation. So they need a transformation before serialization/deserialization.

This PR brings the possibility to completely bypass DjangoLDP's serializer generation and define your own in your model's metaclass using ldp_write_serializer and ldp_read_serializer.

NB: tests incomming.

Edited by Ghost User

Merge request reports