|
|
|
|
|
by the__alchemist
566 days ago
|
|
> Quick, where would you put a high-level business function that touches multiple models? Where would you put the model-level validation for that? It's just python: `descriptive_name.py`. `ingest_validation.py` etc. If this seems too terse, it's because your question was posed in a general way. If you have more info on the sort of business logic you have in mind, or the sort of data validation, I'll reply with more. Could you describe what you have in mind regarding models not tied to the database? If it's the naive interpretation I'm thinking of, use python dataclasses and enums. Django models are specifically to represent database schema. Reading between the lines, perhaps you are looking for something not covered by a web framework? Django's features are for responding to HTTP requests, managing a relational database, auth, email, admin, templates etc. If you're trying to do something not part of this, use other parts of the Python language. Django is a library; Python is the more fundamental tool used to build applications. |
|