-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCKAN-275 feat: Add anatomical entity constraint
- Loading branch information
1 parent
f40300c
commit 3e043ea
Showing
2 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
backend/composer/migrations/0050_alter_anatomicalentityintersection_options_and_more.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,79 @@ | ||
# Generated by Django 4.1.4 on 2024-03-21 16:28 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("composer", "0049_rename_anatomicalentitynew_anatomicalentity_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="anatomicalentityintersection", | ||
options={ | ||
"verbose_name": "Region/Layer Combination", | ||
"verbose_name_plural": "Region/Layer Combinations", | ||
}, | ||
), | ||
migrations.AlterModelOptions( | ||
name="anatomicalentitymeta", | ||
options={ | ||
"ordering": ["name"], | ||
"verbose_name": "Anatomical Entity", | ||
"verbose_name_plural": "Anatomical Entities", | ||
}, | ||
), | ||
migrations.AlterField( | ||
model_name="anatomicalentity", | ||
name="region_layer", | ||
field=models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="composer.anatomicalentityintersection", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="connectivitystatement", | ||
name="origins", | ||
field=models.ManyToManyField( | ||
related_name="origins_relations", to="composer.anatomicalentity" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="destination", | ||
name="anatomical_entities", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="destination_connection_layers", | ||
to="composer.anatomicalentity", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="synonym", | ||
name="anatomical_entity", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="synonyms", | ||
to="composer.anatomicalentity", | ||
), | ||
), | ||
migrations.AddConstraint( | ||
model_name="anatomicalentity", | ||
constraint=models.CheckConstraint( | ||
check=models.Q( | ||
models.Q( | ||
("region_layer__isnull", True), ("simple_entity__isnull", False) | ||
), | ||
models.Q( | ||
("region_layer__isnull", False), ("simple_entity__isnull", True) | ||
), | ||
_connector="OR", | ||
), | ||
name="check_anatomical_entity_exclusivity", | ||
), | ||
), | ||
] |
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