Models¶
Core domain models for the Imbi ecosystem.
Overview¶
The models module provides Pydantic models for all core domain entities (projects, organizations, teams) and the blueprint system for dynamic schema extension.
Model Categories¶
Domain Models¶
- Organization: Top-level organizational units
- Team: Groups within organizations
- Environment: Deployment environments (production, staging, etc.)
- ProjectType: Project categorization and templates
- Project: Services and applications
Blueprint Models¶
- Blueprint: Dynamic schema definitions
- BlueprintAssignment: Blueprint-to-entity relationships
Basic Usage¶
from imbi_common import graph, models
# Create an organization
org = models.Organization(
name="My Company",
slug="my-company",
description="Our organization"
)
await db.create(org)
# Create a team linked to an organization
team = models.Team(
name="Platform Team",
slug="platform-team",
description="Infrastructure and platform",
organization=org
)
await db.create(team)
API Reference¶
Base Classes¶
GraphModel ¶
Bases: BaseModel
Minimal base for any model stored as a graph vertex.
Provides identity (id), timestamps, and
extra='ignore' so AGE metadata is silently dropped.
Subclass Node when you also need name/slug.
Node ¶
Bases: GraphModel
Graph node with business identity fields.
The icon attribute can either be a URL or a CSS
class name.
Domain Models¶
Blueprint Models¶
Blueprint ¶
Bases: Node
generate_and_validate_slug ¶
Generate slug from name if not provided and validate it.
Source code in src/imbi_common/models.py
validate_kind_fields ¶
Validate kind-specific required fields.
Source code in src/imbi_common/models.py
BlueprintAssignment ¶
Bases: BaseModel
BlueprintEdge ¶
Bases: NamedTuple