Currently, I just use the migrations to do a RunSQL and then I make a model with the Meta option managed set appropriately. It works for me, but perhaps something a bit more convenient is in order these days.
From: django-developers@googlegroups.com <django-developers@googlegroups.com> On Behalf Of Vasanth Mohan Sent: Monday, February 21, 2022 8:21 AM To: Django developers (Contributions to Django itself) <django-developers@googlegroups.com> Subject: Adding Support for DB Views Are there any plans to support DB Views ? Would the team be interested in mainlining it if there is a PR for it ? I tend to use DB Views on Postgres at my day job and wouldn't mind adding basic support across Django's supported DBs. I'll probably take inspiration from Knex.js<https://us-east-2.protection.sophos.com?d=knexjs.org&u=aHR0cHM6Ly9rbmV4anMub3JnLyNTY2hlbWEtY3JlYXRlVmlldw==&i=NWVjN2YxNzUxNGEyNzMxNmMyMGRkZGU1&t=VlZ3M2llM3EwdHFtZG03WnZMTFBmdDkxUG1nNFNOUEFwYSt2ZUoyY2dmOD0=&h=b1dc1a4a21604d3ea180a144eae9d276> to implement it. I'm imagining something along the lines of, class NewView(models.ViewModel): def view_qs(self): return qs # Define with QS to be used in CREATE VIEW App_ViewModel as QS; migrations.CreateViewModel( ... ) migrations.DeleteViewModel( ... ) migrations.UpdateViewModel( ... ) -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com<mailto:django-developers+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/e009c1bd-8a68-486a-8b7f-7c3d9e3553een%40googlegroups.com<https://us-east-2.protection.sophos.com?d=google.com&u=aHR0cHM6Ly9ncm91cHMuZ29vZ2xlLmNvbS9kL21zZ2lkL2RqYW5nby1kZXZlbG9wZXJzL2UwMDljMWJkLThhNjgtNDg2YS04YjdmLTdjM2Q5ZTM1NTNlZW4lNDBnb29nbGVncm91cHMuY29tP3V0bV9tZWRpdW09ZW1haWwmdXRtX3NvdXJjZT1mb290ZXI=&i=NWVjN2YxNzUxNGEyNzMxNmMyMGRkZGU1&t=RGFkbkVWSFB3MS90WENZby83RnZTSTltUGVNK2hNYkxuWXZhZXc1WXlZTT0=&h=b1dc1a4a21604d3ea180a144eae9d276>. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/b5f0b99b068a4ea192797708d4f5037d%40Exchange.ISS.LOCAL.