Supported Field Types
Auto-generated from SchemaMapper - Do not edit manually.
Framework M supports these Python types for DocType fields.
Basic Types
| Python Type | SQLAlchemy Type | Description |
|---|---|---|
str | String | Text field |
int | Integer | Integer number |
float | Float | Floating point number |
bool | Boolean | True/False |
Decimal | Numeric | Precise decimal (money) |
Date/Time Types
| Python Type | SQLAlchemy Type | Description |
|---|---|---|
date | Date | Date only |
datetime | DateTime(timezone=True) | Date and time (UTC) |
time | Time | Time only |
Optional Types
| Python Type | Description |
|---|---|
| `str | None` |
| `int | None` |
Collection Types
| Python Type | Description |
|---|---|
list[str] | List of strings (JSON) |
list[ChildDoc] | Child table |
dict[str, Any] | JSON object |
Special Types
| Python Type | SQLAlchemy Type | Description |
|---|---|---|
UUID | UUID | Unique identifier |
bytes | LargeBinary | Binary data |
Field Options (Pydantic)
from pydantic import Field
# Required field
name: str = Field(description="Name")
# Optional with default
status: str = Field(default="Draft", description="Status")
# Nullable optional
email: str | None = Field(default=None, description="Email")
# With constraints
quantity: int = Field(ge=0, le=1000, description="Quantity")
code: str = Field(min_length=3, max_length=20)