Repository navigation
AirModel 0.2.0: Field metadata powered by AirField
AirModel reads field metadata from AirField's typed metadata objects instead of json_schema_extra. Define your fields with AirField() and both the ORM and form renderers discover what they need through the same field_info.metadata protocol.
uv add "AirModel>=0.2.0"What's changed
-
Field()is replaced byAirField(). Import it fromairmodelorairfield:# Before (0.1.x) from airmodel import Field id: int | None = Field(default=None, primary_key=True) # After (0.2.0) from airmodel import AirField id: int | None = AirField(default=None, primary_key=True)
AirFieldis re-exported from both packages, sofrom airmodel import AirFieldworks. -
Primary key detection uses typed metadata. The ORM checks for
PrimaryKey()infield_info.metadata(placed there byAirField(primary_key=True)) instead of readingjson_schema_extra["primary_key"]. This is the sameAnnotatedmetadata protocol that AirField's presentation types (Label,Widget,Choices) use. -
Requires AirField 0.4.0+, which stores all metadata as typed objects in
field_info.metadata.
What's better
- Full documentation rewrite: usage guide covers the complete query API with working examples, installation page lists the Python 3.13+ requirement, and all project URLs use the correct casing for GitHub Pages.
Contributors
@audreyfeldroy (Audrey M. Roy Greenfeld) designed and built this release: the AirField metadata integration, documentation rewrite, and URL corrections.