Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/How to get entity name from CreateEventForum ↗

How to get entity name from CreateEvent

App Development2 posts215 views1 likesLast activity Aug 2023
KR
Krisztian_PinterOP
Aug 2023

Hey,

I’m trying to use stream_many from the Daml Python bindings.

    async with dazl.connect(url = url, act_as = some_party) as client:
        async for event in client.stream_many(
            "Domain:ModelA",
            "Domain:ModelB"
            ).creates():
            logging.info(f">>>> created {event.contract_id} {event.payload}")

Looking at the fields of CreateEvent it seems like I have no way of determining if an event is about the creation of ModelA or ModelB.
Am I missing something?

KR
Krisztian_Pinter
Aug 2023

I found that event.contract_id.value_type has the name of the template.

← Back to Discussions