django-restql: does not work with SerializerMethodField
In case when i use one to many fields i need to pass serializer’s id into different serializer.
def get_a_list(self, obj):
child = b.objects.all()
serializer = BListSerializer(instance=child, context={"obj_id": obj.id}, many=True)
return serializer.data
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (15 by maintainers)
Commits related to this issue
- :sparkles:Add DynamicSerializerMethodField" - Fixes #57 — committed to yezyilomo/django-restql by yezyilomo 5 years ago
Here is how to use it