{"id":13416105,"url":"https://github.com/AndrewIngram/django-extra-views","last_synced_at":"2025-03-14T23:31:19.194Z","repository":{"id":45113302,"uuid":"1757853","full_name":"AndrewIngram/django-extra-views","owner":"AndrewIngram","description":"Django's class-based generic views are awesome, let's have more of them.","archived":false,"fork":false,"pushed_at":"2024-10-16T10:14:06.000Z","size":441,"stargazers_count":1399,"open_issues_count":16,"forks_count":172,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-03-09T05:28:12.248Z","etag":null,"topics":["django"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewIngram.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-05-16T21:47:47.000Z","updated_at":"2025-03-07T02:38:01.000Z","dependencies_parsed_at":"2024-01-11T19:17:19.887Z","dependency_job_id":"643e30dc-a302-49d9-ad77-2f8dc2a3035c","html_url":"https://github.com/AndrewIngram/django-extra-views","commit_stats":{"total_commits":357,"total_committers":63,"mean_commits":5.666666666666667,"dds":0.6834733893557423,"last_synced_commit":"9a6bf95aa71267992b4bc1b08a50a3789cf8c957"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewIngram%2Fdjango-extra-views","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewIngram%2Fdjango-extra-views/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewIngram%2Fdjango-extra-views/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewIngram%2Fdjango-extra-views/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewIngram","download_url":"https://codeload.github.com/AndrewIngram/django-extra-views/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243104061,"owners_count":20236944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django"],"created_at":"2024-07-30T21:00:54.379Z","updated_at":"2025-03-14T23:31:19.170Z","avatar_url":"https://github.com/AndrewIngram.png","language":"Python","funding_links":[],"categories":["Third-Party Packages","Python","Django Utilities"],"sub_categories":["Views","Podcasts"],"readme":"|build| |codecov| |docs-status|\n\nDjango Extra Views - The missing class-based generic views for Django\n========================================================================\n\nDjango-extra-views is a Django package which introduces additional class-based views\nin order to simplify common design patterns such as those found in the Django\nadmin interface.\n\nSupported Python and Django versions: Python 3.6+, Django 2.2-5.1,\nsee `tox.ini \u003chttps://github.com/AndrewIngram/django-extra-views/blob/master/tox.ini\u003e`_ for an up-to-date list.\n\nFull documentation is available at `read the docs`_.\n\n.. _read the docs: https://django-extra-views.readthedocs.io/\n\n.. |build| image:: https://github.com/AndrewIngram/django-extra-views/workflows/Tests/badge.svg\n    :target: https://github.com/AndrewIngram/django-extra-views/\n    :alt: Build Status\n\n.. |codecov| image:: https://codecov.io/github/AndrewIngram/django-extra-views/coverage.svg?branch=master\n    :target: https://codecov.io/github/AndrewIngram/django-extra-views?branch=master\n    :alt: Coverage Status\n\n.. |docs-status| image:: https://readthedocs.org/projects/django-extra-views/badge/?version=latest\n    :target: https://django-extra-views.readthedocs.io/\n    :alt: Documentation Status\n\n.. installation-start\n\nInstallation\n------------\n\nInstall the stable release from pypi (using pip):\n\n.. code-block:: sh\n\n    pip install django-extra-views\n\nOr install the current master branch from github:\n\n.. code-block:: sh\n\n    pip install -e git://github.com/AndrewIngram/django-extra-views.git#egg=django-extra-views\n\nThen add ``'extra_views'`` to your ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n    INSTALLED_APPS = [\n        ...\n        'extra_views',\n        ...\n    ]\n\n.. installation-end\n\n.. features-start\n\nFeatures\n--------\n\n- ``FormSet`` and ``ModelFormSet`` views - The formset equivalents of\n  ``FormView`` and ``ModelFormView``.\n- ``InlineFormSetView`` - Lets you edit a formset related to a model (using\n  Django's ``inlineformset_factory``).\n- ``CreateWithInlinesView`` and ``UpdateWithInlinesView`` - Lets you edit a\n  model and multiple inline formsets all in one view.\n- ``GenericInlineFormSetView``, the equivalent of ``InlineFormSetView`` but for\n  ``GenericForeignKeys``.\n- Support for generic inlines in ``CreateWithInlinesView`` and\n  ``UpdateWithInlinesView``.\n- Support for naming each inline or formset in the template context with\n  ``NamedFormsetsMixin``.\n- ``SortableListMixin`` - Generic mixin for sorting functionality in your views.\n- ``SearchableListMixin`` - Generic mixin for search functionality in your views.\n- ``SuccessMessageMixin`` and ``FormSetSuccessMessageMixin`` - Generic mixins\n  to display success messages after form submission.\n\n.. features-end\n\nStill to do\n-----------\n\nAdd support for pagination in ModelFormSetView and its derivatives, the goal\nbeing to be able to mimic the change_list view in Django's admin. Currently this\nis proving difficult because of how Django's MultipleObjectMixin handles pagination.\n\n.. quick-examples-start\n\nQuick Examples\n--------------\n\nFormSetView\n^^^^^^^^^^^^^^^^^^^^^^^\n\nDefine a :code:`FormSetView`, a view which creates a single formset from\n:code:`django.forms.formset_factory` and adds it to the context.\n\n.. code-block:: python\n\n    from extra_views import FormSetView\n    from my_forms import AddressForm\n\n    class AddressFormSet(FormSetView):\n        form_class = AddressForm\n        template_name = 'address_formset.html'\n\nThen within ``address_formset.html``, render the formset like this:\n\n.. code-block:: html\n\n    \u003cform method=\"post\"\u003e\n      ...\n      {{ formset }}\n      ...\n      \u003cinput type=\"submit\" value=\"Submit\" /\u003e\n    \u003c/form\u003e\n\nModelFormSetView\n^^^^^^^^^^^^^^^^^^^^\n\nDefine a :code:`ModelFormSetView`, a view which works as :code:`FormSetView`\nbut instead renders a model formset using\n:code:`django.forms.modelformset_factory`.\n\n.. code-block:: python\n\n    from extra_views import ModelFormSetView\n\n\n    class ItemFormSetView(ModelFormSetView):\n        model = Item\n        fields = ['name', 'sku']\n        template_name = 'item_formset.html'\n\nCreateWithInlinesView or UpdateWithInlinesView\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nDefine :code:`CreateWithInlinesView` and :code:`UpdateWithInlinesView`,\nviews which render a form to create/update a model instance and its related\ninline formsets. Each of the :code:`InlineFormSetFactory` classes use similar\nclass definitions as the :code:`ModelFormSetView`.\n\n.. code-block:: python\n\n    from extra_views import CreateWithInlinesView, UpdateWithInlinesView, InlineFormSetFactory\n\n\n    class ItemInline(InlineFormSetFactory):\n        model = Item\n        fields = ['sku', 'price', 'name']\n\n\n    class ContactInline(InlineFormSetFactory):\n        model = Contact\n        fields = ['name', 'email']\n\n\n    class CreateOrderView(CreateWithInlinesView):\n        model = Order\n        inlines = [ItemInline, ContactInline]\n        fields = ['customer', 'name']\n        template_name = 'order_and_items.html'\n\n\n    class UpdateOrderView(UpdateWithInlinesView):\n        model = Order\n        inlines = [ItemInline, ContactInline]\n        fields = ['customer', 'name']\n        template_name = 'order_and_items.html'\n\n\nThen within ``order_and_items.html``, render the formset like this:\n\n.. code-block:: html\n\n    \u003cform method=\"post\"\u003e\n      ...\n      {{ form }}\n\n      {% for formset in inlines %}\n        {{ formset }}\n      {% endfor %}\n      ...\n      \u003cinput type=\"submit\" value=\"Submit\" /\u003e\n    \u003c/form\u003e\n\n.. quick-examples-end\n\n\nContributing\n------------\n\nPull requests are welcome. To run all tests locally, setup a virtual environment and run\n\n\n.. code-block:: sh\n\n    tox\n\nBefore committing, use ``pre-commit`` to check all formatting and linting\n\n.. code-block:: sh\n\n    pip install pre-commit\n    pre-commmit install\n\nThis will automatically run ``black``, ``isort`` and ``flake8`` before the commit is accepted.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrewIngram%2Fdjango-extra-views","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAndrewIngram%2Fdjango-extra-views","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAndrewIngram%2Fdjango-extra-views/lists"}