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

Moving core logic out of serializers #743

Open
4amirhosein opened this issue Aug 19, 2023 · 2 comments
Open

Moving core logic out of serializers #743

4amirhosein opened this issue Aug 19, 2023 · 2 comments

Comments

@4amirhosein
Copy link

4amirhosein commented Aug 19, 2023

It is generally a good idea to move logic out of serializers and into view classes. This makes the code more modular and easier to change. It also makes it easier to override serializers to change the structure of the API.

For example, if the logic for generating tokens was moved to the view class, then you could easily override the serializers to change the name of the "refresh" field to "refresh_token" in both requests body and responses. ( for example for being compatible with some other authentication systems ).

@Andrew-Chen-Wang
Copy link
Member

Would love to see an implementation POC

@dpgraham4401
Copy link
Contributor

@4amirhosein Are you still interested in implementing a POC? Mind if I?

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

3 participants