fix [api]: fix film model
This commit is contained in:
parent
ed1cd6a466
commit
7fe4186105
18
server/myapi/migrations/0002_alter_film_actors.py
Normal file
18
server/myapi/migrations/0002_alter_film_actors.py
Normal file
|
@ -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),
|
||||
),
|
||||
]
|
|
@ -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")})'
|
||||
|
||||
|
|
Loading…
Reference in a new issue