Skip to content

Addition to Why not put your business logic in APIs / Views / Serializers / Forms?"" #170

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

Closed
ashrub-holvi opened this issue Mar 20, 2025 · 2 comments

Comments

@ashrub-holvi
Copy link

Hi, just read the style guide, looks good, quite similar to what I think!
Small note to "Why not put your business logic in APIs / Views / Serializers / Forms?" section:
third should be - business logic doesn't related anyhow to way-you-call-it/transport/endpoint and just because of that it should be separated - you may want to call service function from management command, periodic task, admin action whatever, but if you placed it in HTTP API it makes it difficult (e.g. you need to have special API user, perform not needed network call etc).
It's sort of mentioned in another place:

We try to treat Celery as if it's just another interface to our core logic - meaning - don't put business logic there.

but perhaps good to mention it in a main place.

@RadoRado
Copy link
Member

RadoRado commented Apr 9, 2025

@ashrub-holvi This is actually a good comment & I've added a few paragraphs to the section that you mentioned.

Thank you!

@RadoRado
Copy link
Member

Closing the issue for now. Feel free to reopen if you want to add / ask something else.

Cheers!

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

2 participants