oTree Forum >

Dynamic player fields

#1 by Marco

In a previous app we did:

class Player(BasePlayer):
    name = models.StringField()
def get_dynamic_fields(cls) -> Dict[str, models.BooleanField]:
This worked perfectly as some fields were dynamically added.

Now we need something similar but want to compute the dynamic fields based on a session configuration parameter. How can we access player.session.config['X'] here?


Write a reply

Set forum username