-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace is_meta and doesnt_count puzzle fields with puzzle_type
- Loading branch information
Showing
8 changed files
with
107 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.2.13 on 2021-02-08 04:00 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('huntserver', '0072_auto_20201103_1539'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='puzzle', | ||
name='puzzle_type', | ||
field=models.CharField(choices=[('STD', 'A standard puzzle'), ('MET', 'A meta puzzle'), ('NON', 'An unscored puzzle')], default='STD', help_text='The type of puzzle.', max_length=3), | ||
), | ||
migrations.AlterField( | ||
model_name='puzzle', | ||
name='puzzle_page_type', | ||
field=models.CharField(choices=[('PDF', 'Puzzle page displays a PDF'), ('LNK', 'Puzzle page links a webpage'), ('WEB', 'Puzzle page displays a webpage'), ('EMB', 'Puzzle is html embedded in the webpage')], default='WEB', help_text='The type of webpage for this puzzle.', max_length=3), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 2.2.13 on 2021-02-08 04:04 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def set_puzzle_type(apps, schema_editor): | ||
Puzzle = apps.get_model('huntserver', 'Puzzle') | ||
for puzzle in Puzzle.objects.all().iterator(): | ||
if(puzzle.is_meta): | ||
puzzle.puzzle_type = "MET" | ||
elif(puzzle.doesnt_count): | ||
puzzle.puzzle_type = "NON" | ||
else: | ||
puzzle.puzzle_type = "STD" | ||
puzzle.save() | ||
|
||
|
||
def reverse_func(apps, schema_editor): | ||
pass # code for reverting migration, if any | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('huntserver', '0073_auto_20210207_2300'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(set_puzzle_type, reverse_func) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 2.2.13 on 2021-02-08 14:39 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('huntserver', '0074_auto_20210207_2304'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='puzzle', | ||
name='doesnt_count', | ||
), | ||
migrations.RemoveField( | ||
model_name='puzzle', | ||
name='is_meta', | ||
), | ||
migrations.AlterField( | ||
model_name='puzzle', | ||
name='puzzle_type', | ||
field=models.CharField(choices=[('STD', 'Standard'), ('MET', 'Meta'), ('FIN', 'Final'), ('NON', 'Non-puzzle')], default='STD', help_text='The type of puzzle.', max_length=3), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters