django-fmft


Namedjango-fmft JSON
Version 0.3.3 PyPI version JSON
download
home_page
SummaryClass-based Views that integrate django-filters and django-tables2 with model formsets.
upload_time2024-01-14 21:37:06
maintainer
docs_urlNone
author
requires_python<4.0,>=3.8
licenseMIT License Copyright (c) 2023, Joseph Fall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords django_fmft django filtered model formset tabular class-based views django-filter django-tables2 django-extra-views
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Django Filtered Model Formset Tables

[![PyPI Version](https://img.shields.io/pypi/v/django_fmft.svg)][1]
[![Docs Status](https://readthedocs.org/projects/django-fmft/badge/?version=latest)][2]
[![Tests](https://github.com/powderflask/django-fmft/actions/workflows/pytest.yaml/badge.svg)](https://github.com/powderflask/django-fmft/actions/workflows/pytest.yaml)

Re-usable Class-Based Views that integrate [django-filter][3] and
[django-tables2][4] with model formsets. Render and process a user-filterable, 
user-sortable modelformset in a table with just a few lines of code. Rainbows and
unicorns!

[1]: <https://pypi.python.org/pypi/django_fmft>
[2]: <https://django-fmft.readthedocs.io/en/latest>
[3]: <https://django-filter.readthedocs.io/en/stable/index.html>
[4]: <https://django-tables2.readthedocs.io/en/latest/index.html>

## Features

-   Use a [ModelForm][5] / [formset][6] to define editable fields, add / delete, extra 
    forms, etc.
-   Use a [FilterSet][7] to define filters the formset's queryset
-   Use a [Table][8] to lay out the formset, define paging, sorting, etc.
-   Render the [Table][9] with its filtered [formset][10] in just a few lines of 
    template code

[5]: <https://docs.djangoproject.com/en/dev/topics/forms/modelforms/>
[6]: <https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#model-formsets>
[7]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#the-filter>
[8]: <https://django-tables2.readthedocs.io/en/latest/index.html>
[9]: <https://django-tables2.readthedocs.io/en/latest/index.html>
[10]: <https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#model-formsets>

### Views

-   FilteredTableView

    -   Mixes [FilterView][11] with [SingleTableMixin][12] for views that Filter tabular 
        data.


-   FilteredModelFormsetView

    -   Integrates [FilterView][13] with [ModelFormsetView][14] for views that Filter 
        the queryset used by a formset


-   ModelFormsetTableView

    -   Integrates [ModelFormsetView][15] with [SingleTableMixin][16] for views that 
        render a formset in a Table.


-   FilteredModelFormsetTableView

    -   Integrates [FilterView][17], [ModelFormsetView][18], and [SingleTableMixin][19] 
        for views that Filter the queryset used by a formset and render the formset in a
        Table.

[11]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#generic-view-configuration>
[12]: <https://django-tables2.readthedocs.io/en/latest/pages/api-reference.html#views-view-mixins-and-paginators>
[13]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#generic-view-configuration>
[14]: <https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#modelformsetview>
[15]: <https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#modelformsetview>
[16]: <https://django-tables2.readthedocs.io/en/latest/pages/api-reference.html#views-view-mixins-and-paginators>
[17]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#generic-view-configuration>
[18]: <https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#modelformsetview>
[19]: <https://django-tables2.readthedocs.io/en/latest/pages/api-reference.html#views-view-mixins-and-paginators>

*Note:*
Table.Column options `linkify` and `empty_values` are overridden for columns
rendered as form fields
 -   `linkify` is incompatible with a form field representation, so is disabled; 
 -   to ensure \'empty\' form fields are rendered, `empty_values` is set to () (i.e., render all values)

## Quick Start

1. Install the `django-fmft` package from PyPI
    ```bash
    $ pip install django-fmft
    ```

    > For other installation methods see [*Installation*](docs/source/installation.md).

2. Add `'fmft'` to `INSTALLED_APPS`:
    ```python
    INSTALLED_APPS = [
        ...,
        "fmft",
        "django_tables2",
        "django_filters",
        "extra_views",   # optional
           ...,
    ]
    ```

## Get Me Some of That
* [Source Code](https://github.com/powderflask/django-fmft)
* [Read The Docs](https://django-fmft.readthedocs.io/en/latest/)
* [Issues](https://github.com/powderflask/django-fmft/issues)
* [PyPI](https://pypi.org/project/django-fmft)

[MIT License](https://github.com/powderflask/django-fmft/blob/master/LICENSE)

### Check Out the Demo App

1. `pip install -e git+https://github.com/powderflask/django-fmft.git#egg=django-fmft`
2. `python manage.py migrate demo`
3. `python manage.py loaddata demo/fmft_fixture.json`
4. `python manage.py runserver`


### Acknowledgments
Special thanks to BC Hydro, [Chartwell](https://crgl.ca/),
and all [Contributors](https://github.com/powderflask/django-fmft/graphs/contributors)

#### Technology Colophon

This package just glues together the amazing functionality provided by 
[django-filter][20], [django-tables2][21], and [django-extra-views][22].

[20]: <https://django-filter.readthedocs.io/en/stable/index.html>
[21]: <https://django-tables2.readthedocs.io/en/latest/index.html>
[22]: <https://django-extra-views.readthedocs.io/en/latest/index.html>

    Python3, Django, HTML5, CSS3, JavaScript

## For Developers
   ```bash
   $  pip install -r reqirements_dev.txt
   ```

### Tests
   ```bash
   $ pytest
   ```
or
   ```bash
   $ tox
   ```

### Code Style / Linting
   ```bash
   $ isort
   $ black
   $ flake8
   ```

### Versioning
 * [Semantic Versioning](https://semver.org/)
   ```bash
   $ bumpver show
   ```

### Docs
 * [Sphinx](https://www.sphinx-doc.org/en/master/) + [MyST parser](https://myst-parser.readthedocs.io/en/latest/intro.html)
 * [Read The Docs](https://readthedocs.org/projects/django-fmft/)

### Build / Deploy Automation
 * [invoke](https://www.pyinvoke.org/)
   ```bash
   $ invoke -l
   ```
 * [GitHub Actions](https://docs.github.com/en/actions) (see [.github/workflows](https://github.com/powderflask/django-fmft/tree/master/.github/workflows))
 * [GitHub Webhooks](https://docs.github.com/en/webhooks)  (see [settings/hooks](https://github.com/powderflask/django-fmft/settings/hooks))

### Known Issues
 * hidden form fields are rendered in first form field column - can't have dynamically hidden fields,
   hidden on some rows while visible in others, without a little magic.

### TODO
My wish list...
 * write test for case where form field is not included in table
   E.g. as when DELETE field not included in export table

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "django-fmft",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": "",
    "keywords": "django_fmft,Django Filtered Model Formset,Tabular Class-based Views,django-filter,django-tables2,django-extra-views",
    "author": "",
    "author_email": "Joseph Fall <powderflask@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c1/c8/43c73a19792c2b06554d9e29c39e79b5cd072cc6d7c1a25d34df4aa2a6b2/django_fmft-0.3.3.tar.gz",
    "platform": null,
    "description": "# Django Filtered Model Formset Tables\n\n[![PyPI Version](https://img.shields.io/pypi/v/django_fmft.svg)][1]\n[![Docs Status](https://readthedocs.org/projects/django-fmft/badge/?version=latest)][2]\n[![Tests](https://github.com/powderflask/django-fmft/actions/workflows/pytest.yaml/badge.svg)](https://github.com/powderflask/django-fmft/actions/workflows/pytest.yaml)\n\nRe-usable Class-Based Views that integrate [django-filter][3] and\n[django-tables2][4] with model formsets. Render and process a user-filterable, \nuser-sortable modelformset in a table with just a few lines of code. Rainbows and\nunicorns!\n\n[1]: <https://pypi.python.org/pypi/django_fmft>\n[2]: <https://django-fmft.readthedocs.io/en/latest>\n[3]: <https://django-filter.readthedocs.io/en/stable/index.html>\n[4]: <https://django-tables2.readthedocs.io/en/latest/index.html>\n\n## Features\n\n-   Use a [ModelForm][5] / [formset][6] to define editable fields, add / delete, extra \n    forms, etc.\n-   Use a [FilterSet][7] to define filters the formset's queryset\n-   Use a [Table][8] to lay out the formset, define paging, sorting, etc.\n-   Render the [Table][9] with its filtered [formset][10] in just a few lines of \n    template code\n\n[5]: <https://docs.djangoproject.com/en/dev/topics/forms/modelforms/>\n[6]: <https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#model-formsets>\n[7]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#the-filter>\n[8]: <https://django-tables2.readthedocs.io/en/latest/index.html>\n[9]: <https://django-tables2.readthedocs.io/en/latest/index.html>\n[10]: <https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#model-formsets>\n\n### Views\n\n-   FilteredTableView\n\n    -   Mixes [FilterView][11] with [SingleTableMixin][12] for views that Filter tabular \n        data.\n\n\n-   FilteredModelFormsetView\n\n    -   Integrates [FilterView][13] with [ModelFormsetView][14] for views that Filter \n        the queryset used by a formset\n\n\n-   ModelFormsetTableView\n\n    -   Integrates [ModelFormsetView][15] with [SingleTableMixin][16] for views that \n        render a formset in a Table.\n\n\n-   FilteredModelFormsetTableView\n\n    -   Integrates [FilterView][17], [ModelFormsetView][18], and [SingleTableMixin][19] \n        for views that Filter the queryset used by a formset and render the formset in a\n        Table.\n\n[11]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#generic-view-configuration>\n[12]: <https://django-tables2.readthedocs.io/en/latest/pages/api-reference.html#views-view-mixins-and-paginators>\n[13]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#generic-view-configuration>\n[14]: <https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#modelformsetview>\n[15]: <https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#modelformsetview>\n[16]: <https://django-tables2.readthedocs.io/en/latest/pages/api-reference.html#views-view-mixins-and-paginators>\n[17]: <https://django-filter.readthedocs.io/en/stable/guide/usage.html#generic-view-configuration>\n[18]: <https://django-extra-views.readthedocs.io/en/latest/pages/formset-views.html#modelformsetview>\n[19]: <https://django-tables2.readthedocs.io/en/latest/pages/api-reference.html#views-view-mixins-and-paginators>\n\n*Note:*\nTable.Column options `linkify` and `empty_values` are overridden for columns\nrendered as form fields\n -   `linkify` is incompatible with a form field representation, so is disabled; \n -   to ensure \\'empty\\' form fields are rendered, `empty_values` is set to () (i.e., render all values)\n\n## Quick Start\n\n1. Install the `django-fmft` package from PyPI\n    ```bash\n    $ pip install django-fmft\n    ```\n\n    > For other installation methods see [*Installation*](docs/source/installation.md).\n\n2. Add `'fmft'` to `INSTALLED_APPS`:\n    ```python\n    INSTALLED_APPS = [\n        ...,\n        \"fmft\",\n        \"django_tables2\",\n        \"django_filters\",\n        \"extra_views\",   # optional\n           ...,\n    ]\n    ```\n\n## Get Me Some of That\n* [Source Code](https://github.com/powderflask/django-fmft)\n* [Read The Docs](https://django-fmft.readthedocs.io/en/latest/)\n* [Issues](https://github.com/powderflask/django-fmft/issues)\n* [PyPI](https://pypi.org/project/django-fmft)\n\n[MIT License](https://github.com/powderflask/django-fmft/blob/master/LICENSE)\n\n### Check Out the Demo App\n\n1. `pip install -e git+https://github.com/powderflask/django-fmft.git#egg=django-fmft`\n2. `python manage.py migrate demo`\n3. `python manage.py loaddata demo/fmft_fixture.json`\n4. `python manage.py runserver`\n\n\n### Acknowledgments\nSpecial thanks to BC Hydro, [Chartwell](https://crgl.ca/),\nand all [Contributors](https://github.com/powderflask/django-fmft/graphs/contributors)\n\n#### Technology Colophon\n\nThis package just glues together the amazing functionality provided by \n[django-filter][20], [django-tables2][21], and [django-extra-views][22].\n\n[20]: <https://django-filter.readthedocs.io/en/stable/index.html>\n[21]: <https://django-tables2.readthedocs.io/en/latest/index.html>\n[22]: <https://django-extra-views.readthedocs.io/en/latest/index.html>\n\n    Python3, Django, HTML5, CSS3, JavaScript\n\n## For Developers\n   ```bash\n   $  pip install -r reqirements_dev.txt\n   ```\n\n### Tests\n   ```bash\n   $ pytest\n   ```\nor\n   ```bash\n   $ tox\n   ```\n\n### Code Style / Linting\n   ```bash\n   $ isort\n   $ black\n   $ flake8\n   ```\n\n### Versioning\n * [Semantic Versioning](https://semver.org/)\n   ```bash\n   $ bumpver show\n   ```\n\n### Docs\n * [Sphinx](https://www.sphinx-doc.org/en/master/) + [MyST parser](https://myst-parser.readthedocs.io/en/latest/intro.html)\n * [Read The Docs](https://readthedocs.org/projects/django-fmft/)\n\n### Build / Deploy Automation\n * [invoke](https://www.pyinvoke.org/)\n   ```bash\n   $ invoke -l\n   ```\n * [GitHub Actions](https://docs.github.com/en/actions) (see [.github/workflows](https://github.com/powderflask/django-fmft/tree/master/.github/workflows))\n * [GitHub Webhooks](https://docs.github.com/en/webhooks)  (see [settings/hooks](https://github.com/powderflask/django-fmft/settings/hooks))\n\n### Known Issues\n * hidden form fields are rendered in first form field column - can't have dynamically hidden fields,\n   hidden on some rows while visible in others, without a little magic.\n\n### TODO\nMy wish list...\n * write test for case where form field is not included in table\n   E.g. as when DELETE field not included in export table\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2023, Joseph Fall  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Class-based Views that integrate django-filters and django-tables2 with model formsets.",
    "version": "0.3.3",
    "project_urls": {
        "Homepage": "https://github.com/powderflask/django-fmft",
        "Repository": "https://github.com/powderflask/django-fmft"
    },
    "split_keywords": [
        "django_fmft",
        "django filtered model formset",
        "tabular class-based views",
        "django-filter",
        "django-tables2",
        "django-extra-views"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4351c4df1ab9552744136c3245b38a235549bdda36026b23fff8212dca439eba",
                "md5": "bbfb62285d943f910953945a4926291a",
                "sha256": "d3dc50a476223b83041a49a253a333b4ff8e9ff20871e8c33010589d4ace19a7"
            },
            "downloads": -1,
            "filename": "django_fmft-0.3.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bbfb62285d943f910953945a4926291a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 17454,
            "upload_time": "2024-01-14T21:37:05",
            "upload_time_iso_8601": "2024-01-14T21:37:05.063291Z",
            "url": "https://files.pythonhosted.org/packages/43/51/c4df1ab9552744136c3245b38a235549bdda36026b23fff8212dca439eba/django_fmft-0.3.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c1c843c73a19792c2b06554d9e29c39e79b5cd072cc6d7c1a25d34df4aa2a6b2",
                "md5": "228fe34e4f07e0b651eddf20549248b1",
                "sha256": "9ec8a09dde21b6db5e4368e8bb2317f7f3424fa8263d8f17d4a5cc4295a8b7df"
            },
            "downloads": -1,
            "filename": "django_fmft-0.3.3.tar.gz",
            "has_sig": false,
            "md5_digest": "228fe34e4f07e0b651eddf20549248b1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 18524,
            "upload_time": "2024-01-14T21:37:06",
            "upload_time_iso_8601": "2024-01-14T21:37:06.132332Z",
            "url": "https://files.pythonhosted.org/packages/c1/c8/43c73a19792c2b06554d9e29c39e79b5cd072cc6d7c1a25d34df4aa2a6b2/django_fmft-0.3.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-14 21:37:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "powderflask",
    "github_project": "django-fmft",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "django-fmft"
}
        
Elapsed time: 0.20059s