Metadata-Version: 2.4
Name: django-crud-views
Version: 0.7.1
Summary: Django Crud Views
Project-URL: Homepage, https://github.com/jacob-consulting/django-crud-views
Project-URL: Documentation, https://django-crud-views.readthedocs.io/en/latest/
Project-URL: Repository, https://github.com/jacob-consulting/django-crud-views.git
Project-URL: Issues, https://github.com/jacob-consulting/django-crud-views/issues
Project-URL: Changelog, https://github.com/jacob-consulting/django-crud-views/blob/main/CHANGELOG.md
Author-email: Alexander Jacob <alexander.jacob@jacob-consulting.de>
License: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.12
Requires-Dist: crispy-bootstrap5>=2023.10
Requires-Dist: django-bootstrap5>=21.3
Requires-Dist: django-crispy-forms>=2.0
Requires-Dist: django-filter>=21.1
Requires-Dist: django-object-detail>=0.1.7
Requires-Dist: django-tables2>=2.5.3
Requires-Dist: django>=4.2.0
Requires-Dist: pydantic>=2.2.1
Requires-Dist: python-box>=6.0.2
Requires-Dist: typing-extensions>=4.7.1
Provides-Extra: all
Requires-Dist: django-fsm-2-admin>=2.0.1; extra == 'all'
Requires-Dist: django-fsm-2>=4.0.0; extra == 'all'
Requires-Dist: django-guardian>=2.4; extra == 'all'
Requires-Dist: django-ordered-model>=3.4.3; extra == 'all'
Requires-Dist: django-polymorphic>=3.1.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: bump-my-version; extra == 'dev'
Requires-Dist: mkdocs-awesome-pages-plugin>=2.10.1; extra == 'dev'
Requires-Dist: mkdocs-get-deps>=0.2.0; extra == 'dev'
Requires-Dist: mkdocs>=1.6.1; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: guardian
Requires-Dist: django-guardian>=2.4; extra == 'guardian'
Provides-Extra: ordered
Requires-Dist: django-ordered-model>=3.4.3; extra == 'ordered'
Provides-Extra: polymorphic
Requires-Dist: django-polymorphic>=3.1.0; extra == 'polymorphic'
Provides-Extra: test
Requires-Dist: cssselect; extra == 'test'
Requires-Dist: django-guardian>=2.4; extra == 'test'
Requires-Dist: lxml; extra == 'test'
Requires-Dist: nox; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: pytest-cov; extra == 'test'
Requires-Dist: pytest-django; extra == 'test'
Requires-Dist: pytest-mock; extra == 'test'
Requires-Dist: pytest-random-order; extra == 'test'
Requires-Dist: pytest-xdist; extra == 'test'
Provides-Extra: workflow
Requires-Dist: django-fsm-2-admin>=2.0.1; extra == 'workflow'
Requires-Dist: django-fsm-2>=4.0.0; extra == 'workflow'
Description-Content-Type: text/markdown

# Django CRUD Views

![Tests](https://github.com/jacob-consulting/django-crud-views/actions/workflows/tests.yml/badge.svg)
![Lint](https://github.com/jacob-consulting/django-crud-views/actions/workflows/lint.yml/badge.svg)
![Coverage](https://codecov.io/gh/jacob-consulting/django-crud-views/branch/main/graph/badge.svg)
![PyPI](https://img.shields.io/pypi/v/django-crud-views)
![License](https://img.shields.io/pypi/l/django-crud-views)
![Docs](https://readthedocs.org/projects/django-crud-views/badge/?version=latest)

**Stop hand-writing the same list, detail, create, update and delete views for every model.**
Define your model, register a `ViewSet`, and Django CRUD Views generates the pages, wires up
every URL, and cross-links the views — using *your* templates and *your* permissions, right
inside your own app.

## This is all you write

```python
# app/views.py
import django_tables2 as tables

from crud_views.lib.viewset import ViewSet
from crud_views.lib.table import Table
from crud_views.lib.views import (
    ListViewTableMixin,
    ListViewPermissionRequired,
    DetailViewPermissionRequired,
    CreateViewPermissionRequired,
    UpdateViewPermissionRequired,
    DeleteViewPermissionRequired,
)
from .models import Author

cv_author = ViewSet(model=Author, name="author")


class AuthorTable(Table):
    first_name = tables.Column()
    last_name = tables.Column()


class AuthorList(ListViewTableMixin, ListViewPermissionRequired):
    cv_viewset = cv_author
    table_class = AuthorTable


class AuthorDetail(DetailViewPermissionRequired):
    cv_viewset = cv_author


class AuthorCreate(CreateViewPermissionRequired):
    cv_viewset = cv_author
    fields = ["first_name", "last_name"]


class AuthorUpdate(UpdateViewPermissionRequired):
    cv_viewset = cv_author
    fields = ["first_name", "last_name"]


class AuthorDelete(DeleteViewPermissionRequired):
    cv_viewset = cv_author
```

```python
# app/urls.py
urlpatterns = cv_author.urlpatterns
```

You get list, detail, create, update and delete pages, every URL wired up, the views
cross-linked, and access gated by Django's permission system.

## Why developers use it

- **Skip the CRUD boilerplate** — one ViewSet replaces a pile of near-identical class-based views and `urls.py` entries.
- **Views that know their siblings** — automatic cross-linking that respects Django's permissions; no hand-written `reverse()` wiring.
- **Your app, your control** — your templates, URLs and permissions; not locked inside `/admin`.
- **Batteries included** — sortable, filterable, paginated tables, crispy forms and per-object permissions, integrated out of the box.
- **Grows with you** — nested parent/child URLs from ForeignKeys, plus optional workflow (FSM) and polymorphic models; Django system checks catch misconfiguration at startup.

Built on [django-tables2](https://django-tables2.readthedocs.io/en/latest/), [django-filter](https://django-filter.readthedocs.io/en/stable/), [django-crispy-forms](https://django-crispy-forms.readthedocs.io/en/latest/), [django-polymorphic](https://django-polymorphic.readthedocs.io/en/stable/), [django-guardian](https://django-guardian.readthedocs.io/), [django-ordered-model](https://github.com/django-ordered-model/django-ordered-model) and [django-object-detail](https://django-object-detail.readthedocs.io/en/latest/).

## Install

```bash
pip install django-crud-views
```

Optional extras: `django-crud-views[guardian]` (per-object permissions), `django-crud-views[ordered]` (up/down ordering), `django-crud-views[all]` (everything).

## What it is not

- a replacement for Django's admin interface
- a complete page building system with navigations and lots of widgets

## Documentation

Full tutorial and reference: <https://django-crud-views.readthedocs.io>

## Current version
Current version: 0.7.1
