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

Use serializer context in virtual model #35

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

jackson541
Copy link
Contributor

Hello!
This PR is opened to implement the suggestion of issue #33

How mentioned in the issue, the main change in the code was passes the serializer context to virtual model using a new param, that is catch by de kwargs:

    virtual_model_instance = virtual_model(
        user=self.get_request_user(), serializer_context=self.context
    )

https://github.com/jackson541/django-virtual-models/blob/ee215926e9ae5c093f7b25f630f9ce6ab8d03323/django_virtual_models/serializers.py#L77-L79

A new file of tests to Virtual Model Serializers was created to check this implementation.

Thanks for the attention! 😄

@fjsj
Copy link
Member

fjsj commented Dec 1, 2023

Sorry for the late response, but thanks! I will review and merge that soon.

@fjsj
Copy link
Member

fjsj commented Jan 18, 2024

Sorry for the late merge. Merging now and releasing soon!

@fjsj fjsj merged commit 9d8a8af into vintasoftware:main Jan 18, 2024
18 checks passed
@jackson541
Copy link
Contributor Author

Everything is fine. Thanks for the merge!

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

Successfully merging this pull request may close these issues.

2 participants