New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify a recursivity depth #11
Comments
This is not currently supported. I would suggest pruning the dataset before you try to serialize it. If you are deserializing something, then you could deserialize it and then prune. |
I'm using it on a ModelViewset/ModelSerializer so I don't know how I could prune it ? |
Can you set the queryset in the ModelViewSet? |
No... My datastructure is really simple:
I cannot prune or filter the queryset. It will depend on which initial node is requested. I need to limit the depth of the RecursiveField only... Or maybe I'm missing something ? |
You could look in to the django treebeard package for a tree with more features. Or django mptt. I believe there are probably others as well. Or I suppose you could extend the recursive field to add the functionality your desire |
I'll just extend the recursive field to add the functionality I need. Both mptt and treabeard have limitations or defaults that don't work with my project. |
Hi !
Thanks for this great plugin for django rest framework. Is there any way to specify the depth of the recursion ?
I tried using the class Meta
depth
attribute but I don't think the field uses it. What would be the best approach to this ?Best regards,
The text was updated successfully, but these errors were encountered: