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 models, neo4j
# Create an organization
org = models.Organization(
name="My Company",
slug="my-company",
description="Our organization"
)
await neo4j.create_node(org)
# Create a team linked to an organization
team = models.Team(
name="Platform Team",
slug="platform-team",
description="Infrastructure and platform",
organization=org
)
await neo4j.create_node(team)
API Reference¶
Base Classes¶
Node ¶
Bases: BaseModel
Base model for Cypherantic nodes.
The icon attribute can either be a URL or a CSS class name
Domain Models¶
Blueprint Models¶
Blueprint ¶
Bases: BaseModel
generate_and_validate_slug ¶
Generate slug from name if not provided and validate it.
Source code in src/imbi_common/models.py
BlueprintAssignment ¶
Bases: BaseModel
BlueprintEdge ¶
Bases: NamedTuple