Skip to content

Commit

Permalink
Merge pull request #1613 from laws-africa/overturned
Browse files Browse the repository at this point in the history
Add overturned and upheld predicates
  • Loading branch information
nickmwangemi authored Nov 17, 2023
2 parents fd8e1e7 + cbd2b22 commit 2321ade
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions peachjam/migrations/0109_add_overturned_and_upheld_predicates.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Generated by Django 3.2.19 on 2023-11-14 09:13

from django.db import migrations


def add_overturned_and_upheld_predicates(apps, schema_editor):
"""Add the predicates for overturned and upheld."""
Predicate = apps.get_model("peachjam", "Predicate")

overturned_predicate = {
"name": "overturns",
"slug": "overturns",
"verb": "overturns",
"reverse_verb": "is overturned by",
}
Predicate.objects.update_or_create(
name=overturned_predicate["name"], defaults=overturned_predicate
)

upheld_predicate = {
"name": "upholds",
"slug": "upholds",
"verb": "upholds",
"reverse_verb": "is upheld by",
}
Predicate.objects.update_or_create(
name=upheld_predicate["name"], defaults=upheld_predicate
)


class Migration(migrations.Migration):
dependencies = [
("peachjam", "0108_update_ingestor_api_url"),
]

operations = [
migrations.RunPython(
add_overturned_and_upheld_predicates, migrations.RunPython.noop
),
]

0 comments on commit 2321ade

Please sign in to comment.