3 ms·
You can do this with most any ORM by mapping tables on top of views defined in SQL. I regularly use this pattern with Django's ORM to make complex aggregations
by paddy_m 7y ago
You can do this with most any ORM by mapping tables on top of views defined in SQL. I regularly use this pattern with Django's ORM to make complex aggregations only a foreign key away. I can write detailed performant SQL that it is impossible to make an ORM output this way.
- dillonmckay 7y agoWhat are you using to version/migrate views?
- ensignavenger 7y agoI can't answer for the above poster, but the Django ORM Migrations allow for executing raw sql, so it would be possible to manage the view migrations in regualr DJango Migrations. https://docs.djangoproject.com/en/2.2/ref/migration-operations/#runsql https://docs.djangoproject.com/en/2.2/ref/migration-operatio...