Back to Django Software Foundation
GSoC 2026

Add generate_series() support to contrib.postgres

PostgreSQL’s `generate_series()` is powerful for reports and time‑series work, but Django currently lacks a first‑class `ORM API` for it. I will add native support in `django.contrib.postgres` by extending the `ORM` to treat set‑returning functions as table sources using `set_returning`, a new `Relation` abstraction, and `RelationCol` references, implemented via `CROSS JOIN LATERAL`. The result will let developers use `.annotate()`, `.filter()`, `.order_by()`, `.count()`, and `.aggregate()` with generated series without raw SQL. Deliverables include the API surface, type inference for `date/time` series, and a robust test suite covering edge cases, joins, and large sequences.

Project details

Contributor

p-r-a-v-i-n

Mentors

Not available

Technologies

Not listed in the archive