Tools Reference

Tools: Code Generation

Code generation tools scaffold backend apps, models, serializers, viewsets, routes, and more inside a zeebpy 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 zeeb_orm Model class and write it to models.py.

zeeb_create_model(app, name, fields, table_name?, ordering?, timestamps?, 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)
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

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


zeeb_create_serializer

Generate a ModelSerializer and write it to serializers.py.

zeeb_create_serializer(app, model, name?, fields, read_only_fields?, project_id) → str

zeeb_create_viewset

Generate a ModelViewSet and register it in the app's router (urls.py).

zeeb_create_viewset(app, model, name?, serializer?, permissions?, prefix?, project_id) → str
ArgumentDescription
permissionsList of permission class names (default: IsAuthenticatedOrReadOnly)
prefixURL prefix for the router (default: lowercase model + 's')

zeeb_create_action

Add a custom @action to an existing viewset.

zeeb_create_action(app, viewset, name, methods, url_path?, detail?, project_id) → str

zeeb_create_route

Add a standalone function-based view and wire it to a URL.

zeeb_create_route(app, name, method, path, project_id) → str

zeeb_generate_crud

Generate a complete CRUD stack in one call: model + serializer + viewset + migration.

zeeb_generate_crud(app, model_name, fields, project_id) → str

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


zeeb_update_model

Update an existing model by adding, removing, or modifying fields.

zeeb_update_model(app, model, fields_to_add?, fields_to_remove?, project_id) → str

zeeb_create_permission_class

Generate a custom permission class and write it to permissions.py.

zeeb_create_permission_class(app, name, logic_description, project_id) → str

zeeb_update_serializer

Update an existing serializer's field list or add custom to_representation / validation logic.

zeeb_update_serializer(app, serializer, fields?, add_method?, project_id) → str

zeeb_create_signal_receiver

Create a Django-style signal receiver for model events (post_save, pre_delete, etc.).

zeeb_create_signal_receiver(app, model, signal, handler_name, logic_description, project_id) → str

Notes

  • All code generation writes directly to the project workspace. Commit with standard git tools after reviewing.
  • Use zeeb_get_project_structure to inspect the current layout before generating.
  • Use zeeb_list_apps to see all apps in a project.