keymedia/managemedia/models/tv.py

17 lines
819 B
Python

from django.db import models
from .common import VideoFields,MediaTypes
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, max_length=256)
class Networks(models.Model):
name = models.CharField('Network', max_length=256)
class ShowtoNetworks(models.Model):
show = models.ForeignKey('Television', on_delete=models.CASCADE)
network = models.ForeignKey('Networks', on_delete=models.CASCADE)