django-nonrelated-inlines
Django admin inlines for unrelated models
What it is and what it does
django-nonrelated-inlines extends Django's admin interface to support inline editing of models that have no direct foreign key relationship. Normally, Django inlines require a ForeignKey linking the child model to the parent; this package removes that constraint by letting you define custom logic to determine which child objects belong to a parent and how to save that association.
You subclass either NonrelatedStackedInline or NonrelatedTabularInline and implement two methods: get_form_queryset() to return the child objects to display for a given parent, and save_new_instance() to establish the relationship when a new child is saved. This is useful when models are related by a shared attribute (like email address) rather than an explicit database key, or when the relationship is computed or stored elsewhere.
Use it for:
- Display invoices linked to a customer by email address in the customer admin page without a ForeignKey field.
- Show related records from a legacy database where relationships are stored outside the ORM.
- Manage many-to-many-like associations stored in a separate table or external system.
- Build admin inlines for models related by computed logic rather than direct foreign keys.
- Prototype admin interfaces quickly when the relationship model is not yet finalized.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Django admin inline classes that let you display and edit models without explicit foreign key relationships, using custom queryset and save logic you define.
Yes, if you need nonrelated inlines and are using Django 2.0–4.0 on Python 3.6–3.10. The package is dormant (no updates since June 2022), so compatibility with newer Django or Python releases is uncertain. Test thoroughly in your environment before relying on it in production. For active maintenance and support, consider whether a custom admin solution or a maintained alternative would be safer.
Install
django-nonrelated-inlines on PyPI
pip
pip install django-nonrelated-inlinesuv
uv add django-nonrelated-inlinespoetry
poetry add django-nonrelated-inlinesInstalling django-nonrelated-inlines
Before you install
Low install friction with a single dependency on Django. Maintenance is dormant—last release was 2022-06-06 and the repository has not been updated since 2024-10-02, so expect no active support or updates for newer Django versions.
License in practice
MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions.
Quickstart
pip install django-nonrelated-inlines
from django_nonrelated_inlines.admin import NonrelatedStackedInline
class MyInline(NonrelatedStackedInline):
model = MyModel
def get_form_queryset(self, obj):
return MyModel.objects.filter(some_field=obj.some_field)
def save_new_instance(self, parent, instance):
instance.some_field = parent.some_field
Requires Django to be installed; package is dormant and may not support the latest Django versions.
Verify before relying
- Compatibility with Django versions released after 4.0 (latest classifier in fact sheet).
- Whether the package works with current Python 3.10+ minor releases and future versions.
- Active maintenance status and responsiveness to issues or pull requests.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Django |
| Maintenance | dormant — 1,530 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 172,261/month — #10,343 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_nonrelated_inlines-0.2-py3-none-any.whl
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
django-reverse-adminAdds reverse inline support to Django admin for…
permissive · top 15,000 on PyPI
django-admin-inline-paginatorAdds pagination controls to Django admin inline…
permissive · top 5,000 on PyPI
django-admin-inline-paginator-plusAdds pagination to Django admin inline forms,…
permissive · top 15,000 on PyPI
django-admin-sortable2Adds drag-and-drop reordering of model…
permissive · top 5,000 on PyPI
django-modeltreeProvides a simplified interface for navigating…
permissive · top 15,000 on PyPI
django-tree-queriesQuery hierarchical tree structures in Django…
permissive · top 15,000 on PyPI
django-admin-list-filter-dropdownRenders Django admin list filters as dropdown…
permissive · top 5,000 on PyPI
django-admin-autocomplete-filterAdds autocomplete-based filtering to Django…
copyleft · top 15,000 on PyPI