diff --git a/server/myapi/migrations/0002_alter_film_actors.py b/server/myapi/migrations/0002_alter_film_actors.py new file mode 100644 index 0000000..504d372 --- /dev/null +++ b/server/myapi/migrations/0002_alter_film_actors.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2022-03-12 17:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('myapi', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='film', + name='actors', + field=models.JSONField(default=list), + ), + ] diff --git a/server/myapi/models.py b/server/myapi/models.py index 1c1ad8c..55970d4 100644 --- a/server/myapi/models.py +++ b/server/myapi/models.py @@ -18,7 +18,7 @@ class Film(models.Model): projection_date = models.DateTimeField() title = models.CharField(max_length=60) - actors = models.JSONField(default="[]") + actors = models.JSONField(default=list) director = models.CharField(max_length=60) duration = models.DurationField() synopsis = models.TextField() @@ -33,5 +33,5 @@ class Film(models.Model): is_confirmed = models.BooleanField(default=False) def __str__(self): - return f'{self.title} de {self.director} ({projection_date.strftime("%d/%m/%Y")})' + return f'{self.title} de {self.director} ({self.projection_date.strftime("%d/%m/%Y")})'