Changeset 0fbb01a in flexoentity
- Timestamp:
- 11/27/25 10:02:07 (7 weeks ago)
- Branches:
- master
- Children:
- e458b5a
- Parents:
- a26d447
- File:
-
- 1 edited
-
flexoentity/flexo_entity.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
flexoentity/flexo_entity.py
ra26d447 r0fbb01a 211 211 raise ValueError(f"{cls.__name__} must define ENTITY_TYPE") 212 212 213 #if entity_type == EntityType.DOMAIN:214 # DomainManager.create(domain_id=domain_id,215 # fullname=kwargs.get("fullname", ""),216 # description=kwargs.get("description", ""))217 #else:218 # require that this domain already exists219 # if domain_id not in DomainManager.all_domain_ids():220 # raise ValueError(221 # f"Domain '{domain_id}' does not exist. "222 # f"Create it first via Domain.with_domain_id(...)."223 # )224 225 213 flexo_id = FlexOID.safe_generate( 226 214 domain_id=domain_id, 227 215 entity_type=entity_type.value, 228 state= "D",216 state=EntityState.DRAFT.value, 229 217 text=kwargs.get("text_seed", ""), 230 218 version=1, … … 260 248 ) 261 249 262 def to_dict(self): 263 """I return the a dictionary representation of myself""" 250 def meta_dict(self): 264 251 return { 265 252 "flexo_id": str(self.flexo_id), … … 269 256 "originator_id": str(self.originator_id), 270 257 "owner_id": str(self.owner_id), 258 } 259 260 @abstractmethod 261 def _serialize_content(self): 262 return {} 263 264 def to_dict(self): 265 return { 266 "meta": self.meta_dict(), 267 "content": self._serialize_content(), 271 268 } 272 269
Note:
See TracChangeset
for help on using the changeset viewer.
