2 ms·
From the article: > When you declare a Django model by subclassing from its Model base class, Django automatically creates a new relational database table for
by lioeters 7y ago
From the article:
> When you declare a Django model by subclassing from its Model base class, Django automatically creates a new relational database table for it.
That sounds convenient - but feels like too much implicit behavior for me. I almost always prefer a framework that lets (or forces) the user to explicitly specify operations.
Same with "import-time side-effects". When I find myself providing such a shortcut, I usually wrap it so the user must call it explicitly, to control what/when these effects happen.
- ses1984 7y agoThis is handwaving a bit, you still have to manually create the migration that results from your model code change, and also apply the migration. It's "automatic" because you just have to issue a single command for each, and django generates the migration from your code and settings.