Skip to main content

Django Crud Views

Project description

Django CRUD Views

Tests Lint Coverage PyPI License Docs

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

# 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
# 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, django-filter, django-crispy-forms, django-polymorphic, django-guardian, django-ordered-model and django-object-detail.

Install

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.8.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_crud_views-0.8.0.tar.gz (894.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_crud_views-0.8.0-py3-none-any.whl (140.9 kB view details)

Uploaded Python 3

File details

Details for the file django_crud_views-0.8.0.tar.gz.

File metadata

  • Download URL: django_crud_views-0.8.0.tar.gz
  • Upload date:
  • Size: 894.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for django_crud_views-0.8.0.tar.gz
Algorithm Hash digest
SHA256 ec34587dfaea4eae775cea00bde13ad29447f72f4a6fac3da0ea851ac5f6316b
MD5 db9c40f9b00bf9a525cfd0368a6c1c85
BLAKE2b-256 e0d0320a0c63330eec0b8216cd2d9ec323b568bd3a12f943b6fb62a16e1725cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_crud_views-0.8.0.tar.gz:

Publisher: publish.yml on jacob-consulting/django-crud-views

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_crud_views-0.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_crud_views-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1237112efb0d3a31fb8774fee52d5958cff59c2ce3efd3d94294bc2294a97f9e
MD5 9e5f3dcfea28c4ae89086be7a7f2d84f
BLAKE2b-256 49db91102d1c103cc1d38f8f306678542fa82a9c90f39173170d668d21b3b792

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_crud_views-0.8.0-py3-none-any.whl:

Publisher: publish.yml on jacob-consulting/django-crud-views

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page