Changeset ab1cc87 in flexoentity


Ignore:
Timestamp:
10/20/25 11:19:30 (3 months ago)
Author:
Enrico Schwass <ennoausberlin@…>
Branches:
master
Children:
045b864
Parents:
dfce52b
Message:

refactor self.text_seed into a method that subclasses have to implement

Location:
flexoentity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • flexoentity/flexo_entity.py

    rdfce52b rab1cc87  
    9090    domain: str
    9191    etype: EntityType
    92     text_seed: str
    9392    state: EntityState = EntityState.DRAFT
    9493    flexo_id: FlexOID = field(init=False)
     
    10099    def __post_init__(self):
    101100        """Generate ID and content fingerprint."""
    102         self.flexo_id = FlexOID.generate(self.domain, self.etype.short(), self.state.short(), self.text_seed, 1)
     101        self.flexo_id = FlexOID.generate(self.domain,
     102                                         self.etype.short(),
     103                                         self.state.short(),
     104                                         self.text_seed,
     105                                         1)
    103106
    104107    def __str__(self):
     
    128131            data["text_seed"],
    129132            EntityState[data["state"]],
    130             data["version"],
    131133        )
    132134        obj.flexo_id = FlexOID(data["flexo_id"], data.get("signature", ""))
  • flexoentity/id_factory.py

    rdfce52b rab1cc87  
    116116        signature = hashlib.blake2s(sig_seed.encode("utf-8"), digest_size=8).hexdigest().upper()
    117117
    118         return FlexOID(flexo_id_str, signature)    # ──────────────────────────────────────────────────────────────────────────
     118        return FlexOID(flexo_id_str, signature)
     119
     120    # ──────────────────────────────────────────────────────────────────────────
    119121
    120122    @property
Note: See TracChangeset for help on using the changeset viewer.