Data Model
This document describes the data models used in the PuzzleSpring application.
CannedHint Model
A pre-written hint that can be revealed to teams
Fields:
id(AutoField): No description availablepuzzle(ForeignKey): The puzzle this canned hint belongs totext(TextField): The text of the hintorder(IntegerField): Order in which this hint should be shown (lower numbers first)
DisplayOnlyHunt Model
Model for the display only hunt, only to be shown on the archive page
Fields:
id(AutoField): No description availablename(CharField): The name of the hunt as the public will see itdisplay_start_date(DateTimeField): The date/time at which a hunt will become visible to registered usersdisplay_end_date(DateTimeField): The date/time at which a hunt will be archived and available to the publicnum_teams(IntegerField): The number of teams that were registered for this huntnum_puzzles(IntegerField): The number of puzzles this hunt had
Event Model
Event(id, timestamp, type, related_data, related_object_id, user, hunt, team, puzzle)
Fields:
id(AutoField): No description availabletimestamp(DateTimeField): The time of the eventtype(CharField): The type of eventrelated_data(CharField): No description availablerelated_object_id(CharField): No description availableuser(ForeignKey): The user associated with this eventhunt(ForeignKey): The hunt associated with this eventteam(ForeignKey): The team associated with this event, if applicablepuzzle(ForeignKey): The puzzle associated with this event, if applicable
FlatPageProxyObject Model
FlatPageProxyObject(id, url, title, content, enable_comments, template_name, registration_required)
Fields:
id(AutoField): No description availableurl(CharField): No description availabletitle(CharField): No description availablecontent(TextField): No description availableenable_comments(BooleanField): No description availabletemplate_name(CharField): Example: “flatpages/contact_page.html”. If this isn’t provided, the system will use “flatpages/default.html”.registration_required(BooleanField): If this is checked, only logged-in users will be able to view the page.sites(ManyToManyField): No description available
Hint Model
A class to represent a hint to a puzzle
Fields:
id(AutoField): No description availablepuzzle(ForeignKey): The puzzle that this hint is related toteam(ForeignKey): The team that requested the hintrequest(TextField): The text of the request for the hintrequest_time(DateTimeField): Hint request timeresponse(TextField): The text of the response to the hint requestresponse_time(DateTimeField): Hint response timelast_modified_time(DateTimeField): Last time of modificationresponder(ForeignKey): Staff member that has claimed the hint.refunded(BooleanField): Whether or not the hint was refundedfrom_puzzle_pool(BooleanField): Whether this hint was drawn from the puzzle-specific poolcanned_hint(ForeignKey): If this was a canned hint, which one
Hunt Model
Base class for a hunt. Contains basic details about a puzzlehunt.
Fields:
id(AutoField): No description availablename(CharField): The name of the hunt as the public will see itteam_size_limit(IntegerField): No description availablestart_date(DateTimeField): The date/time at which a hunt will become visible to registered usersend_date(DateTimeField): The date/time at which a hunt will be archived and available to the publicdisplay_start_date(DateTimeField): The start date/time displayed to usersdisplay_end_date(DateTimeField): The end date/time displayed to userslocation(CharField): Starting location of the puzzlehuntis_current_hunt(BooleanField): No description availabletemplate_file(FileField): No description availableinfo_page_file(FileField): No description availablehint_lockout(IntegerField): Time (in minutes) teams must wait before a hint can be used on a newly unlocked puzzlecss_file(ForeignKey): No description availableconfig(TextField): Configuration for puzzle, point and hint unlocking ruleshint_pool_type(CharField): Which hint pools are available in this huntcanned_hint_policy(CharField): How canned hints interact with custom hintshint_pool_allocation(CharField): How hints are allocated between puzzle and global pools when both exist
HuntFile Model
HuntFile(id, file, parent)
Fields:
id(AutoField): No description availablefile(FileField): No description availableparent(ForeignKey): No description available
NotificationPlatform Model
A platform that can be used to send notifications (Discord, Email, etc.)
Fields:
id(AutoField): No description availabletype(CharField): The type of notification platformname(CharField): A friendly name for this platform configurationenabled(BooleanField): Whether this platform is currently enabledconfig(JSONField): Platform-specific configuration (API keys, URLs, etc.)
NotificationSubscription Model
A user’s subscription to notifications for specific event types
Fields:
id(AutoField): No description availableuser(ForeignKey): The user who owns this subscriptionplatform(ForeignKey): The platform to send notifications throughhunt(ForeignKey): Optional: limit notifications to a specific huntevent_types(CharField): Comma-separated list of event types to notify ondestination(CharField): Platform-specific destination (webhook URL, email, channel ID, etc.)active(BooleanField): Whether this subscription is currently activecreated_at(DateTimeField): No description availableupdated_at(DateTimeField): No description available
Prepuzzle Model
A class representing a pre-puzzle within a hunt
Fields:
id(AutoField): No description availablename(CharField): The name of the puzzle as it will be seen by hunt participantsreleased(BooleanField): No description availablehunt(OneToOneField): The hunt that this puzzle is a part of, leave blank for no associated hunt.answer(CharField): The answer to the puzzle, not case sensitiveresponse_string(TextField): Data returned to the webpage for use upon solving.allow_spaces(BooleanField): Allow spaces in the answer submissionscase_sensitive(BooleanField): Check for case in answer submissionsallow_non_alphanumeric(BooleanField): Allow for full unicode in answer submissions (rather than just A-Z and 0-9)main_file(ForeignKey): No description available
PrepuzzleFile Model
PrepuzzleFile(id, file, parent)
Fields:
id(AutoField): No description availablefile(FileField): No description availableparent(ForeignKey): No description available
Puzzle Model
A class representing a puzzle within a hunt
Fields:
id(CharField): A 3-8 character hex string that uniquely identifies the puzzlehunt(ForeignKey): The hunt that this puzzle is a part ofname(CharField): The name of the puzzle as it will be seen by hunt participantsorder_number(IntegerField): The number of the puzzle within the hunt, for sorting purposesanswer(CharField): The answer to the puzzle.type(CharField): The type of puzzleextra_data(CharField): A misc. field for any extra data to be stored with the puzzle.allow_spaces(BooleanField): Allow spaces in the answer submissionscase_sensitive(BooleanField): Check for case in answer submissionsallow_non_alphanumeric(BooleanField): Allow for full unicode in answer submissions (rather than just A-Z and 0-9)main_file(ForeignKey): No description availablemain_solution_file(ForeignKey): No description available
PuzzleFile Model
PuzzleFile(id, file, parent)
Fields:
id(AutoField): No description availablefile(FileField): No description availableparent(ForeignKey): No description available
PuzzleStatus Model
A class representing the status of a puzzle for a team
Fields:
id(AutoField): No description availablepuzzle(ForeignKey): The puzzle this status is forteam(ForeignKey): The team that this puzzle status forunlock_time(DateTimeField): The time this puzzle was unlocked for this teamsolve_time(DateTimeField): The time this puzzle was solved for this teamnum_available_hints(IntegerField): Number of puzzle-specific hints availablenum_total_hints_earned(IntegerField): The total number of puzzle-specific hints this puzzle/team pair has earned
Response Model
A class to represent an automated response regex
Fields:
id(AutoField): No description availablepuzzle(ForeignKey): The puzzle that this automated response is related toregex(CharField): The python-style regex that will be checked against the user’s responsetext(CharField): The text to use in the submission response if the regex matched
SolutionFile Model
SolutionFile(id, file, parent)
Fields:
id(AutoField): No description availablefile(FileField): No description availableparent(ForeignKey): No description available
Submission Model
A class representing a submission to a given puzzle from a given team
Fields:
id(AutoField): No description availableteam(ForeignKey): The team that made the submissionsubmission_time(DateTimeField): No description availablesubmission_text(CharField): No description availableresponse_text(CharField): Response to the given answer.puzzle(ForeignKey): The puzzle that this submission is in response tomodified_time(DateTimeField): Last date/time of response modificationuser(ForeignKey): The user who created the submission
Team Model
A class representing a team within a hunt
Fields:
id(AutoField): No description availablename(CharField): The team name as it will be shown to hunt participantshunt(ForeignKey): The hunt that the team is a part ofcustom_data(CharField): A field for custom registration datajoin_code(CharField): The 8 character random alphanumeric password needed for a user to join a teamplaytester(BooleanField): A boolean to indicate if the team is a playtest team and will get early accessplaytest_start_date(DateTimeField): The date/time at which a hunt will become available to the playtestersplaytest_end_date(DateTimeField): The date/time at which a hunt will no longer be available to playtestersnum_available_hints(IntegerField): The number of hints the team currently has available to usenum_total_hints_earned(IntegerField): The total number of hints this team has earned through config rulespoints(IntegerField): The total number of points this team has earned through config rulespuzzle_statuses(ManyToManyField): The statuses of puzzles the team has unlockedmembers(ManyToManyField): Members of this team
Team_members Model
Team_members(id, team, user)
Fields:
id(AutoField): No description availableteam(ForeignKey): No description availableuser(ForeignKey): No description available
TeamRankingRule Model
A class to represent the rules used to rank teams
Fields:
id(AutoField): No description availablehunt(ForeignKey): The hunt that this ranking rule refers torule_type(CharField): The type of ranking rulerule_order(IntegerField): The order in which the rule is appliedvisible(BooleanField): Is this rule visible on the leaderboard?
Update Model
A class to represent puzzle/hunt updates
Fields:
id(AutoField): No description availablehunt(ForeignKey): The hunt that update is part ofpuzzle(ForeignKey): The puzzle this update relates to (leave blank for hunt updates)text(TextField): The text of the update announcement.time(DateTimeField): The time the update was announced
User Model
User(id, password, last_login, is_superuser, first_name, last_name, is_staff, is_active, date_joined, email, display_name)
Fields:
id(AutoField): No description availablepassword(CharField): No description availablelast_login(DateTimeField): No description availableis_superuser(BooleanField): Designates that this user has all permissions without explicitly assigning them.first_name(CharField): No description availablelast_name(CharField): No description availableis_staff(BooleanField): Designates whether the user can log into this admin site.is_active(BooleanField): Designates whether this user should be treated as active. Unselect this instead of deleting accounts.date_joined(DateTimeField): No description availableemail(CharField): No description availabledisplay_name(CharField): No description availablegroups(ManyToManyField): The groups this user belongs to. A user will get all permissions granted to each of their groups.user_permissions(ManyToManyField): Specific permissions for this user.
User_groups Model
User_groups(id, user, group)
Fields:
id(AutoField): No description availableuser(ForeignKey): No description availablegroup(ForeignKey): No description available
User_user_permissions Model
User_user_permissions(id, user, permission)
Fields:
id(AutoField): No description availableuser(ForeignKey): No description availablepermission(ForeignKey): No description available