GSoC 2025 Proposal: Extending Django ORM for Graph-Like Data Models (e.g., SQLAlchemy-style Relationships)
Hello everyone,
I’m a student developer and a Django lover, and currently looking into a possible GSoC 2025 project which I think will assist in advancing Django’s ORM functionality for higher-order data model requirements.
Project Idea:
Extending Django ORM for Graph-Like Data Models (inspired by SQLAlchemy-style relationships)
Problem
Django’s ORM is gracefully integrated and easy to use, but in high-complexity domains—such as knowledge graphs, social graphs, and n-level hierarchies—programmers tend to struggle * with:
- Modeling unorthodox or dynamic relationships
- Navigating bidirectional or self-referential links
- Declaring complex joins or multi-hop relationships
- Programmers currently must either work outside the ORM or resort to using third-party tools.
Proposed Solution
A Django ORM extension or addition that offers graph-like model patterns, including:
- Bidirectional relationship support (like back_populates)
- Simpler traversal for self-referencing/multi-hop models
- Optional lazy/eager loading strategies for performance optimization
- Enlarged queryset API for more expressive relationship querying
The goal is to maintain Django’s simplicity while opening up more flexibility for complex use cases—without compromising backward compatibility.
Technical Notes
- Extend ForeignKey, ManyToManyField, etc., to enable more dynamic linking and traversal logic
- Potentially add a lightweight abstraction layer on top of Django’s ORM to introduce graph-aware APIs
- Maintain full compatibility with Django admin, forms, and migrations
- This will likely involve in-depth work on model relations, queryset chaining, and ORM internals
GSoC Project Details
- Project Size: 350 hours
- Difficulty: Hard
- Focus Area: ORM, Developer Ergonomics
- Impact: Improves Django’s ability to model and manage complex data relationships
What I’m Looking For:
- Feedback on whether this would be a welcome addition to Django
- Thoughts on scope—what’s realistic in a GSoC project?
- Interest from future mentors or feedback from contributors who have already contributed to the ORM
- Ideas on common mistakes to avoid or previous discussions I should know about
I’d appreciate your community feedback and flesh out this idea with your help. Thanks for reading, and I’m extremely enthusiastic about potentially contributing to Django!
Best,
Sai Manvi Pallapothu