Release v0.1.5
This commit is contained in:
40
src/govoplan_tenancy/backend/manifest.py
Normal file
40
src/govoplan_tenancy/backend/manifest.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from govoplan_core.core.access import CAPABILITY_TENANCY_TENANT_RESOLVER
|
||||
from govoplan_core.core.module_guards import persistent_table_uninstall_guard
|
||||
from govoplan_core.core.modules import MigrationSpec, ModuleContext, ModuleManifest
|
||||
from govoplan_core.db.base import Base
|
||||
from govoplan_tenancy.backend.db import models as tenancy_models # noqa: F401 - populate Tenancy ORM metadata
|
||||
|
||||
|
||||
def _tenant_resolver(context: ModuleContext):
|
||||
del context
|
||||
from govoplan_tenancy.backend.capabilities import SqlTenantResolver
|
||||
|
||||
return SqlTenantResolver()
|
||||
|
||||
|
||||
def _route_factory(context: ModuleContext):
|
||||
del context
|
||||
from govoplan_tenancy.backend.api.v1.routes import router
|
||||
|
||||
return router
|
||||
|
||||
|
||||
manifest = ModuleManifest(
|
||||
id="tenancy",
|
||||
name="Tenancy",
|
||||
version="0.1.5",
|
||||
route_factory=_route_factory,
|
||||
migration_spec=MigrationSpec(module_id="tenancy", metadata=Base.metadata),
|
||||
uninstall_guard_providers=(
|
||||
persistent_table_uninstall_guard(tenancy_models.Tenant, label="Tenancy"),
|
||||
),
|
||||
capability_factories={
|
||||
CAPABILITY_TENANCY_TENANT_RESOLVER: _tenant_resolver,
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
def get_manifest() -> ModuleManifest:
|
||||
return manifest
|
||||
Reference in New Issue
Block a user