Skip to content

Commit

Permalink
Add tool to contest model.
Browse files Browse the repository at this point in the history
  • Loading branch information
davepeck committed May 21, 2024
1 parent dde51b2 commit 00e056c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
18 changes: 18 additions & 0 deletions server/vb/migrations/0014_add_tool_to_contest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.0.3 on 2024-05-21 17:43

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('vb', '0013_add_subdomains_flag'),
]

operations = [
migrations.AddField(
model_name='contest',
name='tool',
field=models.CharField(choices=[('vote_america', 'Vote America'), ('rock_the_vote', 'Rock the Vote')], default='vote_america', max_length=32),
),
]
15 changes: 15 additions & 0 deletions server/vb/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ class ContestWorkflow(models.TextChoices):
NONE = "none", "None"


class ContestTool(models.TextChoices):
"""The registration tool for the contest."""

VOTE_AMERICA = "vote_america", "Vote America"
ROCK_THE_VOTE = "rock_the_vote", "Rock the Vote"


class Contest(models.Model):
"""A single contest in the competition."""

Expand All @@ -219,6 +226,14 @@ class Contest(models.Model):
start_at = models.DateTimeField(blank=False)
end_at = models.DateTimeField(blank=False)

# We support running contests with different registration tools.
tool = models.CharField(
max_length=32,
choices=ContestTool.choices,
blank=False,
default=ContestTool.VOTE_AMERICA,
)

# The assumptions here have changed basically weekly as we gather more
# data and learn more. As of this writing, our current assumptions are:
#
Expand Down

0 comments on commit 00e056c

Please sign in to comment.