Last active
September 7, 2019 09:29
-
-
Save menecio/423eb15fd62e21db04807483bd7abc73 to your computer and use it in GitHub Desktop.
Our Movie model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Movie(models.Model): | |
release_date = models.DateField() | |
title = models.CharField(max_length=512) | |
rating = models.PositiveSmallIntegerField() | |
duration = models.DurationField() | |
director = models.CharField(max_length=512) | |
genre = models.CharField(max_length=16) | |
def __str__(self): | |
return f'{self.title} - {self.release_date.year}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment