Skip to content

Commit

Permalink
#100 fix : modify model delete option (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
0321minji authored Aug 31, 2024
1 parent 7b02821 commit e852de6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions lands/migrations/0017_alter_location_item.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.0 on 2024-08-31 12:54

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


class Migration(migrations.Migration):

dependencies = [
('lands', '0016_land_like_cnt_land_likeuser_set'),
]

operations = [
migrations.AlterField(
model_name='location',
name='item',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='lands.item'),
),
]
2 changes: 1 addition & 1 deletion lands/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Location(models.Model):
x=models.CharField(max_length=100,blank=False)
y=models.CharField(max_length=100,blank=False)
z=models.CharField(max_length=100,blank=False)
item=models.ForeignKey('Item',related_name='locations',on_delete=models.SET_NULL, null=True, blank=False)
item=models.ForeignKey('Item',related_name='locations',on_delete=models.CASCADE, null=True, blank=False)
land = models.ForeignKey('Land', related_name='locations', on_delete=models.CASCADE, null=True, blank=True)
show = models.BooleanField(default=False)

Expand Down

0 comments on commit e852de6

Please sign in to comment.