oTree: How to access the player's id from the player class in model.py?
<p>I would like to define a parameter variable via the default attribute id_in_group of the player. However, this attribute does not seem to be accessible via the ways I could think of (such as via BasePlayer.id_in_group).</p>

<p>The code of the class player:</p>

<pre><code>class Player(BasePlayer):
    investment_amount = models.CurrencyField(
        doc="""
        Amount invested by this player.
        """,
        min=0, max=Constants.endowment
    )
    random_number = BasePlayer.id_in_group

    def set_payoffs(self):
        for p in self.get_players():
            p.payoff = 110
</code></pre>

<p>How could I access the attribute id_in_group? Or is it impossible due to the fact that it is a default attribute preset by oTree?</p>