I am trying to make a movie model in Django, but I would like to add the duration of it and I do not know how to do it very well in django, I know that you can add date and time with datetime
in the models. But I only want an hour of duration.
models.py
class Movies(models.Model):
title = models.CharField(max_length=255)
poster = models.ImageField(upload_to='media/movies/')
description = models.TextField()
duration = models.CharField()
genre = models.ForeignKey(Genres)
categorie = models.ForeignKey(Categories)
I have that model, obviously a ChaField
in duration would not work because it would accept alphanumeric values and that's not the idea.
If anyone could help me define a format to add hours, I would appreciate it!