Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuration of group conflict types used for each meeting Fixes
#2770. Commit ready for merge. - Legacy-Id: 19266
- Loading branch information
1 parent
ec86d98
commit 336d762
Showing
18 changed files
with
1,816 additions
and
1,407 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
2,689 changes: 1,351 additions & 1,338 deletions
2,689
ietf/meeting/management/commands/create_dummy_meeting.py
Large diffs are not rendered by default.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
ietf/meeting/migrations/0042_meeting_group_conflict_types.py
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,19 @@ | ||
# Generated by Django 2.2.20 on 2021-05-20 12:28 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('name', '0026_add_conflict_constraintnames'), | ||
('meeting', '0041_assign_correct_constraintnames'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='meeting', | ||
name='group_conflict_types', | ||
field=models.ManyToManyField(blank=True, limit_choices_to={'is_group_conflict': True}, help_text='Types of scheduling conflict between groups to consider', to='name.ConstraintName'), | ||
), | ||
] |
42 changes: 42 additions & 0 deletions
42
ietf/meeting/migrations/0043_populate_meeting_group_conflict_types.py
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,42 @@ | ||
# Generated by Django 2.2.20 on 2021-05-20 12:30 | ||
|
||
from django.db import migrations | ||
from django.db.models import IntegerField | ||
from django.db.models.functions import Cast | ||
|
||
|
||
def forward(apps, schema_editor): | ||
Meeting = apps.get_model('meeting', 'Meeting') | ||
ConstraintName = apps.get_model('name', 'ConstraintName') | ||
|
||
# old for pre-106 | ||
old_constraints = ConstraintName.objects.filter(slug__in=['conflict', 'conflic2', 'conflic3']) | ||
new_constraints = ConstraintName.objects.filter(slug__in=['chair_conflict', 'tech_overlap', 'key_participant']) | ||
|
||
# get meetings with numeric 'number' field to avoid lexicographic ordering | ||
ietf_meetings = Meeting.objects.filter( | ||
type='ietf' | ||
).annotate( | ||
number_as_int=Cast('number', output_field=IntegerField()) | ||
) | ||
|
||
for mtg in ietf_meetings.filter(number_as_int__lt=106): | ||
for cn in old_constraints: | ||
mtg.group_conflict_types.add(cn) | ||
for mtg in ietf_meetings.filter(number_as_int__gte=106): | ||
for cn in new_constraints: | ||
mtg.group_conflict_types.add(cn) | ||
|
||
def reverse(apps, schema_editor): | ||
pass | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('meeting', '0042_meeting_group_conflict_types'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward, reverse), | ||
] |
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
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
Oops, something went wrong.