4 ms·
I'm currently staring at a PostgreSQL database created by a Django app with a lot of inheritance between models. My favorite /s is the table with a single colu
by pmontra 6y ago
I'm currently staring at a PostgreSQL database created by a Django app with a lot of inheritance between models.
My favorite /s is the table with a single column containing the id of the record itself.
It's basically impossible to start from the database and understand what's going on. It will be a huge pain to interface to this database from something else.
On the other side, I'm maintaining another Django app for the same customer, with saner tables (no inheritance) and that's on par with other ORMs.
My take is never use inheritance with Django.
- touisteur 6y agoNever use inheritance at all? I was thinking you could reconstruct part of the app stack by observing and clustering the requests and transactions. But then some people think join is the devil and you'd be back to square one. In a perfect world every app would have only views over what they need and prepared requests. But then CI/CD and all kind of tests can become very painful...
- eyelidlessness 6y agoDjango is just plain bad at data modeling there I said it
- ttz 6y agoI don't know you, but I think we'd be great friends based solely on this statement.
- eyelidlessness 6y agoI don’t make friends as easily as hating on any technology but I do make friends easily on kindness. Hi! I learned a lot great and not great working with DRF. Kind of took it and ran with it on TypeScript and Node. Working on a much better HTTP interface for that platform.