Skip to content
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

Given two serializers with filters_for, context isn't passed to the associated serializer #71

Open
hamfz opened this issue May 20, 2020 · 1 comment

Comments

@hamfz
Copy link

hamfz commented May 20, 2020

As title says, it seems like if I have SerializerA with a filters_for defined (and looking at the context argument), and SerializerA has a relationship defined with SerializerB who also has a filters_for defined, it seems that SerializerB is NOT passed the context object, which can cause errors.

I am not sure if this is expected, and or if I have something configured incorrectly, as the docs are kinda slim on filters_for

Edit: Further, as a suggestion, wouldn't it be appropriate to only call filters_for on the "entry" Serializer, or are there use cases where a context property should cascade through them

@yosiat
Copy link
Owner

yosiat commented Jul 17, 2020

@hamfz currently Panko supports calling filters_for only for the root level serializer (as - if the root serializer has_one/has_many relationships their filters_for won't be called) which might explain your issue here.

I'll try to give it a look and implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants