12👍
✅
Django doesn’t support CTEs directly as these are not common to all databases (MySQL pre-8.0 didn’t support it). There are packages that extend the capability of Django’s ORM to support CTEs. One of these is django-cte. Note that it only supports PostgreSQL.
2👍
It seems that nowadays django-cte is a better option. It works with the existing support for CTEs in underlying database engines.
- How do I register a model that is already registered in admin?
- Convert Python None to JavaScript null
- Django : Can we use .exclude() on .get() in django querysets
- How to upgrade Django on ubuntu?
Source:stackexchange.com