skillfed

django-nonrelated-inlines

Django admin inlines for unrelated models

django-nonrelated-inlines v0.2 172.3K downloads/30d#10,343 on PyPI68
Permissive license MIT DORMANT released

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-inlines

uv

uv add django-nonrelated-inlines

poetry

poetry add django-nonrelated-inlines

Installing 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

Development Status :: 4 - BetaEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 2.0Framework :: Django :: 2.1Framework :: Django :: 2.2Framework :: Django :: 3.0Framework :: Django :: 3.1Framework :: Django :: 3.2Framework :: Django :: 4.0Framework :: Flake8Framework :: toxIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

django admin inlines unrelated modelsdjango inline without foreign keydjango admin custom relationshipdjango nonrelated inline formsdjango admin inline queryset filterdjango stacked tabular inline customdjango admin inline save logic
django-adminorm-extension

More Libraries packages