diff --git a/backend/right_tree/api/migrations/0004_alter_habitatimage_habitat.py b/backend/right_tree/api/migrations/0004_alter_habitatimage_habitat.py new file mode 100644 index 0000000..8bc2ba5 --- /dev/null +++ b/backend/right_tree/api/migrations/0004_alter_habitatimage_habitat.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.8 on 2021-11-04 04:52 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0003_plant_zones'), + ] + + operations = [ + migrations.AlterField( + model_name='habitatimage', + name='habitat', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='api.habitat'), + ), + ] diff --git a/backend/right_tree/api/models.py b/backend/right_tree/api/models.py index ea1bdda..4129cc0 100644 --- a/backend/right_tree/api/models.py +++ b/backend/right_tree/api/models.py @@ -61,7 +61,7 @@ class Habitat(models.Model): class HabitatImage(models.Model): habitat = models.ForeignKey( - Habitat, related_name='habitat', on_delete=models.CASCADE) + Habitat, related_name='images', on_delete=models.CASCADE) name = models.CharField(max_length=50) image_filename = models.CharField(max_length=50, default='-')