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

♻️(backend) move logic functions away from models #509

Open
kernicPanel opened this issue Dec 7, 2023 · 0 comments
Open

♻️(backend) move logic functions away from models #509

kernicPanel opened this issue Dec 7, 2023 · 0 comments

Comments

@kernicPanel
Copy link
Member

Feature Request

Is your feature request related to a problem or unsupported use case? Please describe.
We have several functions in our models that manages some logic.
We want to move them outside of models.
ie: https://github.com/openfun/joanie/blob/main/src/backend/joanie/core/models/products.py#L915

Describe the solution you'd like
Add a "service" module with those functions, and inject into them the original model instance.

Describe alternatives you've considered
Maybe use an existing module in which those functions will fit well ?

Do you want to work on it through a Pull Request?
👍

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

No branches or pull requests

1 participant