4.5. Supported Predicates

This section documents the predicates available for evaluating conditions such as unlocking smartgrid levels, actions, quests, badges etc.


This documentation is extracted automatically from the predicate definition source files. For this reason, the documentation shows the full path to the predicates. To use the predicates in a condition string, only the predicate name (without any qualified prefixes) should be used. In addition, the “user” argument need not to be supplied in the condition string. The predicates can be connected using python boolean operators such as “and” or “or” etc.

Example: The following condition string will check for if the current time has reach round 2 and the user has earned 100 points:

reached_round("Round 2") or has_points(100)

4.5.1. Challenge Predicates

Predicates regarding the state of the challenge.

apps.managers.challenge_mgr.predicates.game_enabled(user, game_name)[source]

Returns True if the game is enabled.

apps.managers.challenge_mgr.predicates.reached_round(user, round_name)[source]

Returns True if the current time was past the start of specified round.

4.5.2. Player Predicates

4.5.3. Smart Grid Game Predicates

Table Of Contents

Previous topic

4.4. Environment Variables

This Page