keymedia/managemedia/models/vgames.py

27 lines
1.1 KiB
Python

from django.db import models
from .common import CommonMediaFields,MediaTypes
class VGames(CommonMediaFields):
tgdb_id = models.PositiveIntegerField('TheGamesDB ID')
platform = models.ForeignKey('Platform', on_delete=models.CASCADE)
cover = models.ImageField('Cover Image', blank=True)
players = models.PositiveIntegerField('Players', blank=True)
coop = models.BooleanField('Co-Op', blank=True)
mc_rating = models.PositiveIntegerField('MetaCritic Rating', blank=True)
class Publishers(models.Model):
name = models.CharField('Publisher Name', max_length=256)
class Developers(models.Model):
name = models.CharField('Developer Name', max_length=256)
class Platform(models.Model):
name = models.CharField('Game System', max_length=256)
class PublisherMap(models.Model):
publisher = models.ForeignKey('Publishers', on_delete=models.CASCADE)
game = models.ForeignKey('VGames', on_delete=models.CASCADE)
class DeveloperMap(models.Model):
developer = models.ForeignKey('Developers', on_delete=models.CASCADE)
game = models.ForeignKey('VGames', on_delete=models.CASCADE)