feat [back]: save imdb and tmdb ids

This commit is contained in:
Alice 2022-06-10 00:22:06 +02:00
parent 31d49bd6b1
commit e8aa8bb460
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,28 @@
# Generated by Django 4.0.3 on 2022-06-10 00:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myapi', '0003_alter_film_banner_link_alter_film_director_and_more'),
]
operations = [
migrations.AddField(
model_name='film',
name='imdb_id',
field=models.CharField(blank=True, max_length=10, null=True),
),
migrations.AddField(
model_name='film',
name='tmdb_id',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='film',
name='movie_format',
field=models.CharField(blank=True, choices=[('35mm', 'Analog 35'), ('Numérique', 'Digital')], max_length=20, null=True),
),
]

View file

@ -33,6 +33,8 @@ class Film(models.Model):
poster_link = models.URLField(null=True, blank=True) poster_link = models.URLField(null=True, blank=True)
banner_link = models.URLField(null=True, blank=True) banner_link = models.URLField(null=True, blank=True)
is_confirmed = models.BooleanField(default=False) is_confirmed = models.BooleanField(default=False)
imdb_id = models.CharField(max_length=10, null=True, blank=True)
tmdb_id = models.IntegerField(null=True, blank=True)
def __str__(self): def __str__(self):
return f'{self.title} de {self.director} ({self.projection_date.strftime("%d/%m/%Y")})' return f'{self.title} de {self.director} ({self.projection_date.strftime("%d/%m/%Y")})'