Tools Reference

Tools: Code Generation

Code generation tools scaffold backend apps, models, serializers, viewsets, routes, and more inside a backend project.

All code generation tools accept a project_id argument to target a specific project.


zeeb_create_app

Create a new app inside an existing project.

zeeb_create_app(name: str, project_id: str) → str

Arguments:

NameTypeDescription
namestringApp name in snake_case (e.g. blog, payments)
project_idstringUUID of the target project

Example prompt: "Add a blog app to my project"


zeeb_create_model

Generate a data model and add it to the app's data models.

zeeb_create_model(app, name, fields, table_name?, ordering?, timestamps?, meta?, project_id) → str

Arguments:

NameTypeDescription
appstringApp name (e.g. blog)
namestringModel class name (e.g. Post)
fieldslist[dict]List of field definitions (see below)
table_namestring?Override database table name
orderinglist[str]?Default ordering (e.g. ["-created_at"])
timestampsboolAuto-add created_at / updated_at (default: true)
metadict?Extra Meta options: unique_together, indexes, constraints, abstract, verbose_name, and more
project_idstringUUID of the target project

Field definition keys:

KeyRequiredDescription
nameField name
typestring, text, int, bigint, float, decimal, bool, date, datetime, json, uuid, email, slug, url, foreignkey, manytomany
max_lengthFor string/email/slug/url fields
nullAllow null values
blankAllow blank in forms
defaultDefault value
uniqueAdd unique constraint
indexAdd database index
relatedRelated model name (for foreignkey/manytomany)
on_deleteCASCADE, SET_NULL, PROTECT
choicesEnumerated choices for the field
help_textHuman-readable help text
rawEscape hatch: emit this exact field declaration verbatim

Example prompt: "Create a Post model in the blog app with title (string), body (text), and author (foreignkey to User)"


zeeb_create_user_model

Generate a custom user model based on the framework's base user model and register it as the project's user model. Must run before the first migration of the project.

zeeb_create_user_model(app, model_name?, extra_fields?, set_auth_user_model?, project_id) → str

Arguments:

NameTypeDescription
appstringApp that will own the user model
model_namestringClass name (default: User)
extra_fieldslist[dict]?Additional field definitions (same keys as zeeb_create_model)
set_auth_user_modelboolRegister the new model as the project's user model (default: true)
project_idstringUUID of the target project

Example prompt: "Create a custom User model in the accounts app with a phone_number field"


zeeb_create_serializer

Generate a serializer and add it to the app's serializers.

zeeb_create_serializer(app, model, name?, fields, read_only_fields?, extra_fields?, validate_fields?, project_id) → str
ArgumentDescription
extra_fieldsDeclared fields such as SerializerMethodField or nested serializers, with get_* method stubs generated
validate_fieldsField names to generate validate_<field> method stubs for

zeeb_create_viewset

Generate a full-CRUD resource endpoint and register it in the app's routes.

zeeb_create_viewset(app, model, name?, serializer?, permissions?, prefix?, read_only?, lookup_field?, pagination?, throttles?, search_fields?, ordering_fields?, filterset?, authentication?, project_id) → str
ArgumentDescription
permissionsPermission classes — one or more entries, combined with AND (default: IsAuthenticatedOrReadOnly). Each entry is a built-in, a class created with zeeb_create_permission_class, or apps.<app>.permissions.<Class>; imports are wired automatically
prefixURL prefix for the router (default: pluralized lowercase model name, e.g. Companycompanies)
read_onlyGenerate a read-only resource endpoint (list/retrieve only)
lookup_fieldDetail-route lookup field (default: pk, e.g. slug)
paginationPagination style: page, limit_offset, or cursor
throttlesThrottle class names to apply to the viewset
search_fieldsFields for ?search= full-text lookups
ordering_fieldsFields allowed in ?ordering=
filtersetFilterSet class to attach (see zeeb_create_filterset)
authenticationAuthentication classes — optional override of the project-wide default, tried in order (first scheme that recognizes the credentials wins). Omit to keep the global scheme wired by zeeb_setup_auth

zeeb_create_filterset

Generate a FilterSet class in apps/<app>/filters.py for query-parameter filtering. Attach it to a viewset via the filterset argument of zeeb_create_viewset or zeeb_update_viewset.

zeeb_create_filterset(app, model, filter_fields, project_id) → str

Arguments:

NameTypeDescription
appstringApp name
modelstringModel the FilterSet targets
filter_fieldsdictField → lookup list, e.g. {"status": ["exact", "in"], "price": ["gte", "lte"]}
project_idstringUUID of the target project

Example prompt: "Add filtering to products so I can filter by status and price range"


zeeb_create_action

Add a custom @action to an existing viewset.

zeeb_create_action(app, viewset, name, detail?, methods?, url_path?, description?, body?, permissions?, project_id) → str
ArgumentDescription
detailtrue for a per-object route (/{id}/<name>), false for a collection route (default: true)
methodsHTTP methods (default: ["post"])
bodyThe action's implementation as Python source — pass the real logic here instead of editing views.py
permissionsPermission classes for this action only (same forms as zeeb_create_viewset, ANDed). Omit to inherit the viewset's permissions

zeeb_create_route

Add a standalone HTTP endpoint (non-CRUD) and wire it into routing.

zeeb_create_route(app, path, method?, name?, description?, request_schema?, response_model?, body?, imports?, project_id) → str
ArgumentDescription
pathURL path (e.g. /webhook/stripe, /search)
methodHTTP method (default: get)
bodyThe handler implementation as Python source — without it a TODO stub is generated
importsExtra import lines the handler body needs
request_schema / response_modelSchema model names for request validation / response serialization

zeeb_generate_crud

Generate a complete CRUD stack in one call: model + serializer + resource endpoint + route registration.

zeeb_generate_crud(app, model, fields, project_id, ...) → str

Forwards all options of the underlying tools: meta and the extended field spec keys (choices, help_text, raw) from zeeb_create_model, extra_fields / validate_fields from zeeb_create_serializer, and permissions, read_only, lookup_field, pagination, throttles, search_fields, ordering_fields, filterset, authentication from zeeb_create_viewset.

Example prompt: "Generate full CRUD for a Product model with name (string), price (decimal), and stock (int)"


zeeb_update_model

Replace an existing model's field list. fields is the complete new set of fields — the model is regenerated from it. For incremental changes use zeeb_add_field / zeeb_remove_field instead.

zeeb_update_model(app, name, fields, table_name?, ordering?, timestamps?, project_id) → str

zeeb_create_permission_class

Generate a custom permission class and write it to permissions.py. Attach it to an endpoint via zeeb_create_viewset(permissions=[...]) or zeeb_update_viewset(permissions=[...]).

zeeb_create_permission_class(app, class_name, logic?, project_id) → str
ArgumentDescription
logicPreset behavior: deny_all (default), allow_all, owner_only, staff_only, or authenticated

zeeb_update_serializer

Update an existing serializer's exposed or read-only field lists.

zeeb_update_serializer(app, model, fields?, read_only_fields?, project_id) → str

zeeb_update_viewset

Update options on an existing model's viewset in place — without regenerating it. Custom @action methods are preserved.

zeeb_update_viewset(app, model, permissions?, lookup_field?, pagination?, throttles?, search_fields?, ordering_fields?, authentication?, project_id) → str

Arguments:

NameTypeDescription
appstringApp name
modelstringModel whose viewset to update
permissionslist[str]?Replace the permission classes (one or more entries, combined with AND)
lookup_fieldstring?Change the detail-route lookup field
paginationstring?page, limit_offset, or cursor
throttleslist[str]?Throttle classes to apply
search_fieldslist[str]?Fields for ?search= lookups
ordering_fieldslist[str]?Fields allowed in ?ordering=
authenticationlist[str]?Set or replace the authentication classes (tried in order; omit to leave unchanged)
project_idstringUUID of the target project

Example prompt: "Switch the Product viewset to cursor pagination and make it searchable by name"


zeeb_create_signal_receiver

Create a model lifecycle hook for model events (post_save, pre_delete, etc.).

zeeb_create_signal_receiver(app, signal_name, model_name, function_name, project_id) → str
ArgumentDescription
signal_nameModel event: pre_save, post_save, pre_delete, or post_delete
model_nameModel the receiver listens on
function_nameName for the generated receiver function stub

Notes

  • All code generation writes directly to the project workspace; every project-scoped tool call commits and pushes automatically.
  • Use zeeb_get_project_structure to inspect the current layout before generating.
  • Use zeeb_list_apps to see all apps in a project.
  • Auth and project-wide API configuration (JWT auth, OAuth providers, throttling, versioning) is covered in Auth & API Configuration.