Skip to content

Agent affiliation

AgentAffiliation ΒΆ

Bases: DomainObject

An affiliation between two agents (e.g. agent a is a researcher, agent b is a university).

Source code in ckanext/attribution/model/agent_affiliation.py
42
43
44
45
46
47
48
49
50
51
52
53
54
class AgentAffiliation(DomainObject):
    """
    An affiliation between two agents (e.g. agent a is a researcher, agent b is a
    university).
    """

    @property
    def agents(self):
        return [self._agent_a, self._agent_b]

    def other_agent(self, agent_id):
        assert agent_id in [self.agent_a_id, self.agent_b_id]
        return self._agent_a if agent_id == self.agent_b_id else self._agent_b