|build_badge| |coverage_badge| |docs_badge|
**django-nested-admin** is a project that makes it possible to nest
admin inlines (that is, to define inlines on InlineModelAdmin classes).
It is compatible with Django 3.2+ and Python 3.7+ and works with or
without Grappelli. When Grappelli is not installed it allows
Grappelli-like drag-and-drop functionality.
Installation
============
The recommended way to install django-nested-admin is from
`PyPI <https://pypi.python.org/pypi/django-nested-admin>`_::
pip install django-nested-admin
Alternatively, one can install a development copy of django-nested-admin
from source::
pip install -e git+git://github.com/theatlantic/django-nested-admin.git#egg=django-nested-admin
If the source is already checked out, use setuptools to install::
python setup.py develop
Configuration
=============
To use django-nested-admin in your project, ``"nested_admin"`` must be added
to the ``INSTALLED_APPS`` in your settings:
.. code-block:: python
INSTALLED_APPS = (
# ...
'nested_admin',
)
If you’re using `django-grappelli <https://github.com/sehmaschine/django-grappelli>`_,
you will also need to add to include ``nested_admin.urls`` in your urlpatterns:
.. code-block:: python
urlpatterns = [
# ...
path('_nested_admin/', include('nested_admin.urls')),
]
Example Usage
=============
In order to use ``django-nested-admin``, use the following classes in
place of their django admin equivalents:
======================== ======================
**django.contrib.admin** **nested_admin**
------------------------ ----------------------
ModelAdmin NestedModelAdmin
InlineModelAdmin NestedInlineModelAdmin
StackedInline NestedStackedInline
TabularInline NestedTabularInline
======================== ======================
There is also ``nested_admin.NestedGenericStackedInline`` and
``nested_admin.NestedGenericTabularInline`` which are the nesting-capable
versions of ``GenericStackedInline`` and ``GenericTabularInline`` in
``django.contrib.contenttypes.admin``.
.. code-block:: python
# An example admin.py for a Table of Contents app
from django.contrib import admin
import nested_admin
from .models import TableOfContents, TocArticle, TocSection
class TocArticleInline(nested_admin.NestedStackedInline):
model = TocArticle
sortable_field_name = "position"
class TocSectionInline(nested_admin.NestedStackedInline):
model = TocSection
sortable_field_name = "position"
inlines = [TocArticleInline]
class TableOfContentsAdmin(nested_admin.NestedModelAdmin):
inlines = [TocSectionInline]
admin.site.register(TableOfContents, TableOfContentsAdmin)
Testing
=======
django-nested-admin has fairly extensive test coverage.
The best way to run the tests is with `tox <https://testrun.org/tox/latest/>`_,
which runs the tests against all supported Django installs. To run the tests
within a virtualenv run ``pytest`` from the repository directory. The tests
require a selenium webdriver to be installed. By default the tests run with
phantomjs, but it is also possible to run the tests with the chrome webdriver
by passing ``--selenosis-driver=chrome`` to ``pytest`` or, if running with
tox, running ``tox -- --selenosis-driver=chrome``. See ``pytest --help`` for
a complete list of the options available.
Contributing
============
This project uses `webpack <https://webpack.js.org/>`_ for building its
javascript and css. To install the dependencies for the build process, run
``npm install`` from the root of the repository. You can then run
``npm run build`` to rebuild the static files.
License
=======
The django code is licensed under the `Simplified BSD
License <http://opensource.org/licenses/BSD-2-Clause>`_. View the
``LICENSE`` file under the root directory for complete license and
copyright information.
.. |build_badge| image:: https://github.com/theatlantic/django-nested-admin/workflows/Test/badge.svg
:target: https://github.com/theatlantic/django-nested-admin/actions
.. |coverage_badge| image:: https://codecov.io/gh/theatlantic/django-nested-admin/branch/master/graph/badge.svg
:target: https://codecov.io/gh/theatlantic/django-nested-admin
.. |docs_badge| image:: https://readthedocs.org/projects/django-nested-admin/badge/?version=latest
:target: http://django-nested-admin.readthedocs.org/en/latest/
Raw data
{
"_id": null,
"home_page": "https://github.com/theatlantic/django-nested-admin",
"name": "django-nested-admin",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "The Atlantic",
"author_email": "programmers@theatlantic.com",
"download_url": "https://files.pythonhosted.org/packages/7d/a7/846e35abde80bed006d71d00edc17e172a46ecc4edd114366ad0427316ed/django_nested_admin-4.1.6.tar.gz",
"platform": "any",
"description": "|build_badge| |coverage_badge| |docs_badge|\n\n**django-nested-admin** is a project that makes it possible to nest\nadmin inlines (that is, to define inlines on InlineModelAdmin classes).\nIt is compatible with Django 3.2+ and Python 3.7+ and works with or\nwithout Grappelli. When Grappelli is not installed it allows\nGrappelli-like drag-and-drop functionality.\n\nInstallation\n============\n\nThe recommended way to install django-nested-admin is from\n`PyPI <https://pypi.python.org/pypi/django-nested-admin>`_::\n\n pip install django-nested-admin\n\nAlternatively, one can install a development copy of django-nested-admin\nfrom source::\n\n pip install -e git+git://github.com/theatlantic/django-nested-admin.git#egg=django-nested-admin\n\nIf the source is already checked out, use setuptools to install::\n\n python setup.py develop\n\nConfiguration\n=============\n\nTo use django-nested-admin in your project, ``\"nested_admin\"`` must be added\nto the ``INSTALLED_APPS`` in your settings:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n # ...\n 'nested_admin',\n )\n\nIf you\u2019re using `django-grappelli <https://github.com/sehmaschine/django-grappelli>`_,\nyou will also need to add to include ``nested_admin.urls`` in your urlpatterns:\n\n.. code-block:: python\n\n urlpatterns = [\n # ...\n path('_nested_admin/', include('nested_admin.urls')),\n ]\n\nExample Usage\n=============\n\nIn order to use ``django-nested-admin``, use the following classes in\nplace of their django admin equivalents:\n\n======================== ======================\n**django.contrib.admin** **nested_admin** \n------------------------ ----------------------\nModelAdmin NestedModelAdmin \nInlineModelAdmin NestedInlineModelAdmin\nStackedInline NestedStackedInline \nTabularInline NestedTabularInline\n======================== ======================\n\nThere is also ``nested_admin.NestedGenericStackedInline`` and\n``nested_admin.NestedGenericTabularInline`` which are the nesting-capable\nversions of ``GenericStackedInline`` and ``GenericTabularInline`` in\n``django.contrib.contenttypes.admin``.\n\n.. code-block:: python\n\n # An example admin.py for a Table of Contents app\n\n from django.contrib import admin\n import nested_admin\n\n from .models import TableOfContents, TocArticle, TocSection\n\n class TocArticleInline(nested_admin.NestedStackedInline):\n model = TocArticle\n sortable_field_name = \"position\"\n\n class TocSectionInline(nested_admin.NestedStackedInline):\n model = TocSection\n sortable_field_name = \"position\"\n inlines = [TocArticleInline]\n\n class TableOfContentsAdmin(nested_admin.NestedModelAdmin):\n inlines = [TocSectionInline]\n\n admin.site.register(TableOfContents, TableOfContentsAdmin)\n\nTesting\n=======\n\ndjango-nested-admin has fairly extensive test coverage.\nThe best way to run the tests is with `tox <https://testrun.org/tox/latest/>`_,\nwhich runs the tests against all supported Django installs. To run the tests\nwithin a virtualenv run ``pytest`` from the repository directory. The tests\nrequire a selenium webdriver to be installed. By default the tests run with\nphantomjs, but it is also possible to run the tests with the chrome webdriver\nby passing ``--selenosis-driver=chrome`` to ``pytest`` or, if running with\ntox, running ``tox -- --selenosis-driver=chrome``. See ``pytest --help`` for\na complete list of the options available.\n\nContributing\n============\n\nThis project uses `webpack <https://webpack.js.org/>`_ for building its\njavascript and css. To install the dependencies for the build process, run\n``npm install`` from the root of the repository. You can then run\n``npm run build`` to rebuild the static files.\n\nLicense\n=======\n\nThe django code is licensed under the `Simplified BSD\nLicense <http://opensource.org/licenses/BSD-2-Clause>`_. View the\n``LICENSE`` file under the root directory for complete license and\ncopyright information.\n\n.. |build_badge| image:: https://github.com/theatlantic/django-nested-admin/workflows/Test/badge.svg\n :target: https://github.com/theatlantic/django-nested-admin/actions\n.. |coverage_badge| image:: https://codecov.io/gh/theatlantic/django-nested-admin/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/theatlantic/django-nested-admin\n.. |docs_badge| image:: https://readthedocs.org/projects/django-nested-admin/badge/?version=latest\n :target: http://django-nested-admin.readthedocs.org/en/latest/\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Django admin classes that allow for nested inlines",
"version": "4.1.6",
"project_urls": {
"Homepage": "https://github.com/theatlantic/django-nested-admin"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "29fdb27411aa40f35d57667eed368587aa2ee0bb5693897b6d7b01847296a1fb",
"md5": "02047e9365ba6cc7450fd3eac6ae218e",
"sha256": "ae3e1d910631e6cc3b5815d80129f18c6c081b7dd7f775bf392d9bb1ac88ef93"
},
"downloads": -1,
"filename": "django_nested_admin-4.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "02047e9365ba6cc7450fd3eac6ae218e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 466567,
"upload_time": "2025-10-23T18:40:48",
"upload_time_iso_8601": "2025-10-23T18:40:48.635899Z",
"url": "https://files.pythonhosted.org/packages/29/fd/b27411aa40f35d57667eed368587aa2ee0bb5693897b6d7b01847296a1fb/django_nested_admin-4.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7da7846e35abde80bed006d71d00edc17e172a46ecc4edd114366ad0427316ed",
"md5": "b88b9676abdb4920c4c0da0588045704",
"sha256": "0222475cc343e7b8813d7a5db583cddef15f5c0f44dbe17b91b4d682db7bd73a"
},
"downloads": -1,
"filename": "django_nested_admin-4.1.6.tar.gz",
"has_sig": false,
"md5_digest": "b88b9676abdb4920c4c0da0588045704",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 422990,
"upload_time": "2025-10-23T18:41:26",
"upload_time_iso_8601": "2025-10-23T18:41:26.167803Z",
"url": "https://files.pythonhosted.org/packages/7d/a7/846e35abde80bed006d71d00edc17e172a46ecc4edd114366ad0427316ed/django_nested_admin-4.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-23 18:41:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "theatlantic",
"github_project": "django-nested-admin",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"tox": true,
"lcname": "django-nested-admin"
}