Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a4d86c0
Impliment CSV, JSON exports for tab cards. Refactor existing tab card…
JoeyRubas Nov 28, 2024
45569f8
various misc tweaks
JoeyRubas Nov 28, 2024
bd9911c
censor team names
JoeyRubas Nov 28, 2024
844a428
some changes to address the PR comments
JoeyRubas Dec 21, 2024
19dd796
formatting for linter
JoeyRubas Jan 16, 2025
47d3b7b
down to 1 linter error
JoeyRubas Jan 16, 2025
acc7369
fix last lint error
JoeyRubas Jan 18, 2025
fe2fc5d
fixed linting errors, added dedicated page for exports, merged export…
JoeyRubas Jan 18, 2025
e4d9729
final final linting errors fixed (hopefully)
JoeyRubas Jan 18, 2025
097040d
add ids to CSV
JoeyRubas Feb 10, 2025
bc31a65
fix header order
JoeyRubas Feb 10, 2025
0cc33a7
Merge remote-tracking branch 'origin/master' into csv-export
JoeyRubas Feb 27, 2025
6ed827b
bugfix
JoeyRubas Feb 27, 2025
8f9e6fe
Merge remote-tracking branch 'origin/master' into csv-export
JoeyRubas Feb 27, 2025
e21029e
url -> path
JoeyRubas Mar 2, 2025
f771277
Merge remote-tracking branch 'origin/master' into csv-export
JoeyRubas Mar 2, 2025
6a11683
lint nit
JoeyRubas Mar 2, 2025
df5c0d5
Merge branch 'master' into csv-export
BenMusch Mar 8, 2025
18d98d9
Merge remote-tracking branch 'origin/master' into csv-export
JoeyRubas Nov 10, 2025
c12c9dc
nullsave
JoeyRubas Nov 10, 2025
66b4b81
add export to s3
JoeyRubas Nov 10, 2025
1db7e15
Merge branch 'master' into csv-export
JoeyRubas Nov 10, 2025
e925af8
cleanup
JoeyRubas Nov 10, 2025
e7c7994
Update mittab/urls.py
JoeyRubas Nov 10, 2025
c766387
Update mittab/templates/common/_form.html
JoeyRubas Nov 10, 2025
bd3307f
Update mittab/libs/data_export/tab_card.py
JoeyRubas Nov 10, 2025
06ba62e
final cleanup
JoeyRubas Nov 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
/htmlcov/

# Translations
*.mo
Expand All @@ -52,6 +53,7 @@ mittab/backups/

# venv
venv/
.venv/

# doc stuff
docs/_static/
Expand Down Expand Up @@ -122,3 +124,10 @@ typings/
.env

*.dump.sql

#webdriver
google-chrome-stable_current_amd64.deb
/chromedriver-linux64/

#vscode
.vscode/
9 changes: 9 additions & 0 deletions mittab/apps/tab/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,12 @@ def save(self, _commit=True):
breaking_team.save()

return round_obj
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing blank line before class definition. According to PEP 8, there should be two blank lines before top-level class definitions. Add a blank line before class ExportFormatForm.

Suggested change
return round_obj
return round_obj

Copilot uses AI. Check for mistakes.


class ExportFormatForm(forms.Form):
EXPORT_CHOICES = [
("csv", "CSV"),
("xml", "XML"),
("json", "JSON"),
]
format = forms.ChoiceField(choices=EXPORT_CHOICES, label="Export Format")
30 changes: 22 additions & 8 deletions mittab/apps/tab/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def save(self,
update_fields=None):
cache_logic.invalidate_cache("tab_settings_%s" % self.key,
cache_logic.PERSISTENT)
super(TabSettings, self).save(force_insert, force_update, using, update_fields)
super(TabSettings, self).save(force_insert,
force_update, using, update_fields)


class School(models.Model):
Expand Down Expand Up @@ -106,7 +107,8 @@ def save(self,
while not self.tiebreaker or \
Debater.objects.filter(tiebreaker=self.tiebreaker).exists():
self.tiebreaker = random.choice(range(0, 2**16))
super(Debater, self).save(force_insert, force_update, using, update_fields)
super(Debater, self).save(force_insert,
force_update, using, update_fields)

@property
def num_teams(self):
Expand Down Expand Up @@ -206,7 +208,8 @@ def set_unique_team_code(self):
haikunator = Haikunator()

def gen_haiku_and_clean():
code = haikunator.haikunate(token_length=0).replace("-", " ").title()
code = haikunator.haikunate(
token_length=0).replace("-", " ").title()

return code

Expand All @@ -230,7 +233,8 @@ def save(self,
Team.objects.filter(tiebreaker=self.tiebreaker).exists():
self.tiebreaker = random.choice(range(0, 2**16))

super(Team, self).save(force_insert, force_update, using, update_fields)
super(Team, self).save(force_insert,
force_update, using, update_fields)

@property
def display_backend(self):
Expand Down Expand Up @@ -270,6 +274,12 @@ def debaters_display(self):
return ", ".join([debater.name for debater in self.debaters.all()])
return ""

def get_or_create_team_code(self):
if not self.team_code:
self.set_unique_team_code()
self.save()
return self.team_code

class Meta:
ordering = ["pk"]

Expand Down Expand Up @@ -345,8 +355,10 @@ class Meta:


class Scratch(models.Model):
judge = models.ForeignKey(Judge, related_name="scratches", on_delete=models.CASCADE)
team = models.ForeignKey(Team, related_name="scratches", on_delete=models.CASCADE)
judge = models.ForeignKey(
Judge, related_name="scratches", on_delete=models.CASCADE)
team = models.ForeignKey(
Team, related_name="scratches", on_delete=models.CASCADE)
TEAM_SCRATCH = 0
TAB_SCRATCH = 1
TYPE_CHOICES = (
Expand Down Expand Up @@ -407,7 +419,8 @@ class Outround(models.Model):
blank=True,
on_delete=models.CASCADE,
related_name="chair_outround")
judges = models.ManyToManyField(Judge, blank=True, related_name="judges_outrounds")
judges = models.ManyToManyField(
Judge, blank=True, related_name="judges_outrounds")
UNKNOWN = 0
GOV = 1
OPP = 2
Expand Down Expand Up @@ -532,7 +545,8 @@ def delete(self, using=None, keep_parents=False):


class Bye(models.Model):
bye_team = models.ForeignKey(Team, related_name="byes", on_delete=models.CASCADE)
bye_team = models.ForeignKey(
Team, related_name="byes", on_delete=models.CASCADE)
round_number = models.IntegerField()

def __str__(self):
Expand Down
Loading