[Django] #37115: Title: Add support for Generic Relations / Table-Valued Expressions in the ORM

6 views
Skip to first unread message

Django

unread,
May 21, 2026, 11:01:06 PMMay 21
to django-...@googlegroups.com
#37115: Title: Add support for Generic Relations / Table-Valued Expressions in the
ORM
-------------------------------------+-------------------------------------
Reporter: Pravin | Owner: Pravin
Type: New | Status: assigned
feature |
Component: Database | Version: 6.0
layer (models, ORM) | Keywords: Table Value
Severity: Normal | expressions, Set returning
| functions, SRF, generate_series,
Triage Stage: | Postgres, Orm
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This ticket proposes the implementation of a generic Relation API within
the Django ORM to support Table-Valued Expressions (TVEs) and functions
that return sets of rows.

A generic Relation API will lay the groundwork for cleanly implementing
several advanced querying features across different databases, including:

- PostgreSQL `generate_series()` (and potential equivalents for other
backends).
- Subqueries acting as derived tables directly within the `FROM` clause.
- Database abstraction for `json_each()` , `JSON_TABLE` and
`json_array_elements()`.
- Deprecation of `FilteredRelation`.

References & Context
Django Forum Discussion: [https://forum.djangoproject.com/t/proposal-add-
generate-series-support-to-contrib-postgres/21947]
Django New Features Thread:[https://github.com/django/new-
features/issues/25]
Official GSoC 2026 Announcement:
[https://www.djangoproject.com/weblog/2026/may/05/gsoc-2026-django-
contributors/]
--
Ticket URL: <https://code.djangoproject.com/ticket/37115>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 21, 2026, 11:04:17 PMMay 21
to django-...@googlegroups.com
#37115: Title: Add support for Generic Relations / Table-Valued Expressions in the
ORM
-------------------------------------+-------------------------------------
Reporter: Pravin | Owner: Pravin
Type: New feature | Status: assigned
Component: Database layer | Version: 6.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: Table Value | Triage Stage:
expressions, Set returning | Unreviewed
functions, SRF, generate_series, |
Postgres, Orm |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Pravin:

Old description:

> This ticket proposes the implementation of a generic Relation API within
> the Django ORM to support Table-Valued Expressions (TVEs) and functions
> that return sets of rows.
>
> A generic Relation API will lay the groundwork for cleanly implementing
> several advanced querying features across different databases, including:
>
> - PostgreSQL `generate_series()` (and potential equivalents for other
> backends).
> - Subqueries acting as derived tables directly within the `FROM` clause.
> - Database abstraction for `json_each()` , `JSON_TABLE` and
> `json_array_elements()`.
> - Deprecation of `FilteredRelation`.
>
> References & Context
> Django Forum Discussion: [https://forum.djangoproject.com/t/proposal-add-
> generate-series-support-to-contrib-postgres/21947]
> Django New Features Thread:[https://github.com/django/new-
> features/issues/25]
> Official GSoC 2026 Announcement:
> [https://www.djangoproject.com/weblog/2026/may/05/gsoc-2026-django-
> contributors/]

New description:

This ticket proposes the implementation of a generic Relation API within
the Django ORM to support Table-Valued Expressions (TVEs) and functions
that return sets of rows.

A generic Relation API will lay the groundwork for cleanly implementing
several advanced querying features across different databases, including:

- PostgreSQL `generate_series()` (and potential equivalents for other
backends).
- Subqueries acting as derived tables directly within the `FROM` clause.
- Database abstraction for `json_each()` , `JSON_TABLE` and
`json_array_elements()`.
- Deprecation of `FilteredRelation`.


== References & Context
- Django Forum Discussion: [https://forum.djangoproject.com/t/proposal-
add-generate-series-support-to-contrib-postgres/21947]
- Django New Features Thread:[https://github.com/django/new-
features/issues/25]
- Official GSoC 2026 Announcement:
[https://www.djangoproject.com/weblog/2026/may/05/gsoc-2026-django-
contributors/]

--
--
Ticket URL: <https://code.djangoproject.com/ticket/37115#comment:1>
Reply all
Reply to author
Forward
0 new messages