Opened 71 minutes ago

Last modified 28 minutes ago

#37115 assigned New feature

Title: Add support for Generic Relations / Table-Valued Expressions in the ORM — at Initial Version

Reported by: Pravin Owned by: Pravin
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: Table-Valued expressions, Set-returning functions, SRF, generate_series, Postgres, Orm
Cc: Pravin, Lily, Simon Charette, Bhuvnesh, David Sanders Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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/

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top