Skip to content
CCPEDIAby Unity Nodes
App Development

How to get entity name from CreateEvent

2 posts222 views1 likesLast activity Aug 2023

  1. Krisztian_PinterOP 1

    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?

  2. Krisztian_Pinter

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