4.2.2.12. Package apps.widgets.quests
¶
quests module.
-
apps.widgets.quests.
MAX_AVAILABLE_QUESTS
= 3¶ The number of quests a user can have at any one time.
4.2.2.12.1. Module apps.widgets.quests.models
¶
Defines the Quest Model.
-
class
apps.widgets.quests.models.
Quest
(*args, **kwargs)[source]¶ Represents a quest in the database.
Parameters: - id (AutoField) – Id
- name (CharField) – The name of the quest.
- quest_slug (SlugField) – A unique identifier of the quest. Automatically generated if left blank.
- description (TextField) – Discription of the quest. It should outline the steps to completing this quest. Uses Markdown formatting.
- priority (IntegerField) – Quest with lower values (higher priority) will be listed first.
- unlock_conditions (TextField) – Conditions a user needs to meet in order to have this quest be available (appeared in the Quest widget). Uses Makahiki Predicates.
- completion_conditions (TextField) – Conditions a user needs to meet in order to complete the quest. Uses Makahiki Predicates.
-
class
apps.widgets.quests.models.
QuestMember
(*args, **kwargs)[source]¶ Represents a user’s participation in a quest. Shouldn’t be in the admin interface, since there shouldn’t be a reason to edit instances.
Parameters: - id (AutoField) – Id
- user_id (ForeignKey) – User
- quest_id (ForeignKey) – Quest
- completed (BooleanField) – True if the user completed the quest.
- opt_out (BooleanField) – True if the user opts out of the quest.
- created_at (DateTimeField) – Created at
- updated_at (DateTimeField) – Updated at
4.2.2.12.2. Module apps.widgets.quests.views
¶
Implemenat view processing for Quests.
4.2.2.12.3. Module apps.widgets.quests.admin
¶
Quest administrative interface, enabling checking of quest conditions.
-
class
apps.widgets.quests.admin.
QuestAdmin
(model, admin_site)[source]¶ Admin
-
form
¶ alias of
QuestAdminForm
-
4.2.2.12.4. Module apps.widgets.quests.management.commands.verify_quests
¶
Invocation: python manage.py verify_quests
Verifies that all of the existing quest lock and unlock condition strings are valid. Prints out the names of any invalid quest conditions.