generate_model
Define a clearskies Model class with specified columns, backend, and optional hooks. Generates ready-to-use model code for your application.
Instructions
Generate a clearskies Model class definition.
Args:
name: The model class name in PascalCase (e.g. "User", "OrderProduct").
columns: List of column definitions. Each dict has:
- name (str): Column name
- type (str): Column type (e.g. "String", "Integer", "Uuid", "BelongsToId")
- options (dict, optional): Keyword arguments for the column constructor
backend_type: Backend class name (default: "MemoryBackend").
backend_options: Keyword arguments for the backend constructor.
id_column_name: The name of the id column (default: "id").
hooks: Optional list of hook methods to include stubs for (e.g. ["pre_save", "post_save", "save_finished"]).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| hooks | No | ||
| columns | Yes | ||
| backend_type | No | MemoryBackend | |
| id_column_name | No | id | |
| backend_options | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |