keymedia/managemedia/models/vgames.py

27 lines
1.1 KiB
Python
Raw Normal View History

2020-06-08 20:25:22 -04:00
from django.db import models
2020-06-12 17:49:58 -04:00
from .common import CommonMediaFields,MediaTypes
2020-06-12 11:17:30 -04:00
class VGames(CommonMediaFields):
2020-06-08 19:21:18 -04:00
tgdb_id = models.PositiveIntegerField('TheGamesDB ID')
2020-06-12 15:43:36 -04:00
platform = models.ForeignKey('Platform', on_delete=models.CASCADE)
2020-06-08 20:25:22 -04:00
cover = models.ImageField('Cover Image', blank=True)
players = models.PositiveIntegerField('Players', blank=True)
coop = models.BooleanField('Co-Op', blank=True)
2020-06-12 15:43:36 -04:00
mc_rating = models.PositiveIntegerField('MetaCritic Rating', blank=True)
2020-06-08 19:21:18 -04:00
2020-06-12 11:17:30 -04:00
class Publishers(models.Model):
2020-06-12 17:49:58 -04:00
name = models.CharField('Publisher Name', max_length=256)
2020-06-08 20:25:22 -04:00
2020-06-12 11:17:30 -04:00
class Developers(models.Model):
2020-06-12 17:49:58 -04:00
name = models.CharField('Developer Name', max_length=256)
2020-06-08 20:25:22 -04:00
2020-06-12 17:49:58 -04:00
class Platform(models.Model):
name = models.CharField('Game System', max_length=256)
2020-06-08 20:25:22 -04:00
2020-06-12 11:17:30 -04:00
class PublisherMap(models.Model):
2020-06-12 15:43:36 -04:00
publisher = models.ForeignKey('Publishers', on_delete=models.CASCADE)
game = models.ForeignKey('VGames', on_delete=models.CASCADE)
2020-06-08 20:25:22 -04:00
2020-06-12 11:17:30 -04:00
class DeveloperMap(models.Model):
2020-06-12 15:43:36 -04:00
developer = models.ForeignKey('Developers', on_delete=models.CASCADE)
game = models.ForeignKey('VGames', on_delete=models.CASCADE)