Skip to content

Moving core logic out of serializers #743

Open
@4amirhosein

Description

@4amirhosein

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 ).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions