Hi,
I'll start with some context so the question makes more sense.
We run a multi-tenant SaaS where we use database multi-tenancy (one db per tenant).
Part of offering is extensive and rather complex reporting, which is hard to do in the django ORM in a performant manner.
The ability to use the orms filter abilities is important to us, and so we've been defining views and wrapping them in unmanaged models.
We aren't thrilled about this for multiple reasons, but primarily because migrations are no fun when you do database multi tenancy.
This use case being reporting, we'd be fine with a "Read Only Model", where in the models Meta classs we'd specify some SQL (much like raw) and the SQLCompiler would use that SQL to select from and filter (much like a view).
Is this possible ? Does anyone have thoughts on how to get started ?
Thanks