keymedia/managemedia/models/tv.py

17 lines
776 B
Python

from django.db import models
from .common import VideoFields
class Television(VideoFields):
episodes = models.PositiveIntegerField('Number of Episodes', blank=True)
seasons = models.PositiveIntegerField('Number of Seasons', blank=True)
first_aired = models.DateField('First Aired Date', blank=True)
last_aired = models.DateField('Last Aired Date', blank=True)
networks = models.ForeignKey('Networks', on_delete=models.CASCADE, blank=True)
status = models.CharField('Status', blank=True)
class Networks(models.Model):
name = models.CharField('Network')
class ShowtoNetworks(models.Model):
show = models.ForeignKey('Television', on_delete=models.CASCADE)
network = models.ForeignKey('Networks', on_delete=models.CASCADE)