dabapps / django-rest-framework-serialization-spec

DEPRECATED, see https://github.com/dabapps/django-readers instead
MIT License
11 stars 0 forks source link

Move logic out of `get_queryset` method so it can be used without mixin #63

Closed RealOrangeOne closed 3 years ago

RealOrangeOne commented 3 years ago

Using a mixin library without the mixin? Not as crazy as it sounds, honest!

It comes down to needing to do 2 SSM serialization flows and stitch them together. The reason being I need to filter down a related 1 to many to being exactly 1 value (or null). The way i'm doing that is by serializing the main object, using Python to resolve the inner one, serializing that and poking it back in.

Really what I need is a plugin which you give some Q objects, a spec, and whether it's 1 or many, and it to serialize that. Filtered kinda does that, but doesn't do single instances.

pmg103 commented 3 years ago

Functional decomposition is always good but I think I need to hear a bit more about the use case for exporting this internal mechanism as part of the library’s public API before approving