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:
| Name | Type | Description |
|---|---|---|
name | string | App name in snake_case (e.g. blog, payments) |
project_id | string | UUID 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:
| Name | Type | Description |
|---|---|---|
app | string | App name (e.g. blog) |
name | string | Model class name (e.g. Post) |
fields | list[dict] | List of field definitions (see below) |
table_name | string? | Override database table name |
ordering | list[str]? | Default ordering (e.g. ["-created_at"]) |
timestamps | bool | Auto-add created_at / updated_at (default: true) |
project_id | string | UUID of the target project |
Field definition keys:
| Key | Required | Description |
|---|---|---|
name | ✅ | Field name |
type | ✅ | string, text, int, bigint, float, decimal, bool, date, datetime, json, uuid, email, slug, url, foreignkey, manytomany |
max_length | — | For string/email/slug/url fields |
null | — | Allow null values |
blank | — | Allow blank in forms |
default | — | Default value |
unique | — | Add unique constraint |
index | — | Add database index |
related | — | Related model name (for foreignkey/manytomany) |
on_delete | — | CASCADE, 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
| Argument | Description |
|---|---|
permissions | List of permission class names (default: IsAuthenticatedOrReadOnly) |
prefix | URL 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_structureto inspect the current layout before generating. - Use
zeeb_list_appsto see all apps in a project.