It's fairly common for example to see an app introduce some models, Python APIs to work with them, and business logic, and then to have a sub-app for the web API and bits relating to that, and a sub-app for the admin interfaces (we don't use the Django admin).
Example:
- orders
- refunds
- shipping
- royal_mail
- click_and_collect
- fraud
- fraud_blacklists
- returns
This means that working on our Click and Collect integration, one only needs to hold in their head the current app, and maybe some APIs provided by the apps above it. It's relatively uncommon to import across apps on different branches of the tree, and when we do that's typically only to top-level apps containing the most core models, or for very explicit public APIs provided to the whole site (which might be re-exported from an __init__.py up the tree anyway).I find it a pretty nice codebase to work on. We're hiring too https://www.thread.com/jobs/software-engineer
...
I agree, but the main demand for something like this is going to be a client who wants to create their own forms on demand without touching Model code.
It is very much a hack-- the technical debt of it just gets kicked down the road for someone else to correct, the first of which is the unfortunate analyst who used to churn out weekly reports with a handful of SQL statements but now has to run an entire ETL pipeline/data science marathon to correct all the inconsistencies.
I can see the use-cases, but I think that level of dynamism should be built into the data model, not built by building a dynamic data model.
To take an extreme example, if you had a single table with the columns "key" and "value", you'd be able to encode any structure you wanted at the application level.
This would likely be a bad idea (at least for general purposes), but there are levels in between that would work. Models like "Form" and "Form Item", and maybe even "FormItemType" and "FormItemField", things like that, could represent fairly complex dynamic structures.
If you wanted to _fundamentally_ build your product around this concept that's fine, but Django probably isn't the right framework, however no feature is worth the pain of this.
For what it's worth, Django models and doing good relational design solve a huge number of problems. We've got ~380 Django apps and ~350 models and haven't yet needed dynamic models.