Skip to main content

CRUD Package

The CRUD package is Zango's primary data management layer. It provides BaseCrudView, table classes, and form classes that together handle create, read, update, and delete operations for any model — with built-in role-based access, row actions, and a React frontend via CrudHandler.

What It Does

LayerClassPurpose
Backend viewBaseCrudViewWires a model, table, and form into a single endpoint
TableModelTableDefines columns, sorting, search, and row actions
FormBaseFormDefines fields for create/edit operations
FrontendCrudHandlerReact component that renders the full list + detail UI

When to Use CRUD

Use BaseCrudView when the operation maps cleanly to list / create / edit / delete on a single model. For multi-model flows, multi-step wizards, or custom business logic, write a plain Django class-based view instead.

Install Order

Packages must be installed in this order — CRUD depends on AppBuilder:

appbuilder → crud → workflow

Quick Example

Backend view:

from ...packages.crud.base import BaseCrudView
from .tables import PatientTable
from .forms import PatientForm

class PatientCrudView(BaseCrudView):
page_title = "Patients"
add_btn_title = "Add Patient" # required
table = PatientTable
form = PatientForm

def display_add_button_check(self, request):
return True

Frontend (React):

import { CrudHandler } from '@zango-core/crud/table';

const Patients = () => (
<CrudHandler api_endpoint="/patients/" headerProps={{ title: "Patients" }} />
);

Sections

SectionDescription
InstallationInstall the package via App Panel
CRUD ViewConfigure BaseCrudView
TablesDefine columns and row actions
FormsDefine fields for create/edit
Frontend IntegrationUse CrudHandler and FormRenderer in React