Skip to content

Commit

Permalink
Merge pull request #259 from johnpooch/develop
Browse files Browse the repository at this point in the history
Convert Piece.dislodged_from to ForeignKey
  • Loading branch information
johnpooch authored May 10, 2021
2 parents 7746215 + 96ecd47 commit df436f3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions core/migrations/0010_alter_piecestate_dislodged_from.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.2 on 2021-05-10 15:23

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('core', '0009_piece_turn_destroyed'),
]

operations = [
migrations.AlterField(
model_name='piecestate',
name='dislodged_from',
field=models.ForeignKey(blank=True, help_text="True if the piece was dislodged via a land attack during this turn. The piece's attacker_territory field will be set to this value next turn.", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pieces_dislodged_from_here', to='core.territory'),
),
]
2 changes: 1 addition & 1 deletion core/models/piece.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class PieceState(PerTurnModel):
on_delete=models.CASCADE,
related_name='piece_dislodged',
)
dislodged_from = models.OneToOneField(
dislodged_from = models.ForeignKey(
'Territory',
blank=True,
null=True,
Expand Down

0 comments on commit df436f3

Please sign in to comment.