Changeset 32fdc4a in flexoentity
- Timestamp:
- 11/20/25 11:41:36 (8 weeks ago)
- Branches:
- master
- Children:
- fd1913f
- Parents:
- d0a379f
- Location:
- flexoentity
- Files:
-
- 2 edited
-
domain_manager.py (modified) (1 diff)
-
flexo_entity.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flexoentity/domain_manager.py
rd0a379f r32fdc4a 76 76 return cls.register(domain) 77 77 78 @classmethod79 def get_or_create(cls, code: str, **kwargs) -> Domain:80 """Return existing domain or create+register new one."""81 if code in cls._by_code:82 return cls._by_code[code]83 return cls.create(code, **kwargs)84 85 78 # --------------------------------------------------------------- 86 79 # Utility -
flexoentity/flexo_entity.py
rd0a379f r32fdc4a 214 214 description=kwargs.get("description", "")) 215 215 else: 216 DomainManager.get_or_create(domain_id=domain_id, **kwargs) 216 # require that this domain already exists 217 if domain_id not in DomainManager.all_domain_ids(): 218 raise ValueError( 219 f"Domain '{domain_id}' does not exist. " 220 f"Create it first via Domain.with_domain_id(...)." 221 ) 217 222 218 223 flexo_id = FlexOID.safe_generate(
Note:
See TracChangeset
for help on using the changeset viewer.
