diff --git a/db.sqlite3 b/db.sqlite3 index 68a5cb2..4d7303f 100644 Binary files a/db.sqlite3 and b/db.sqlite3 differ diff --git a/keymedia/__pycache__/settings.cpython-37.pyc b/keymedia/__pycache__/settings.cpython-37.pyc index 63cc594..700968e 100644 Binary files a/keymedia/__pycache__/settings.cpython-37.pyc and b/keymedia/__pycache__/settings.cpython-37.pyc differ diff --git a/keymedia/__pycache__/urls.cpython-37.pyc b/keymedia/__pycache__/urls.cpython-37.pyc index b66bb1d..0b7c1a6 100644 Binary files a/keymedia/__pycache__/urls.cpython-37.pyc and b/keymedia/__pycache__/urls.cpython-37.pyc differ diff --git a/keymedia/settings.py b/keymedia/settings.py index 5787c4c..32a4c9d 100644 --- a/keymedia/settings.py +++ b/keymedia/settings.py @@ -75,8 +75,12 @@ WSGI_APPLICATION = 'keymedia.wsgi.application' DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': 'keymedia', + 'USER': 'keymedia', + 'PASSWORD': 'atomiccomic', + 'HOST': 'localhost', + 'PORT': '5432', } } diff --git a/managemedia/models.py b/managemedia/models.py deleted file mode 100644 index 9129897..0000000 --- a/managemedia/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -class diff --git a/managemedia/models/__init__.py b/managemedia/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/managemedia/models/books.py b/managemedia/models/books.py new file mode 100644 index 0000000..e69de29 diff --git a/managemedia/models/common.py b/managemedia/models/common.py new file mode 100644 index 0000000..f1083f0 --- /dev/null +++ b/managemedia/models/common.py @@ -0,0 +1,41 @@ +from django.db import models + +class MediaTypes(models.Model): + MEDIA_TYPES = [ + ('vg', 'Video Games'), + ('mo', 'Movies'), + ('tv', 'TV Shows'), + ('bo', 'Books'), + ] + media_type = models.CharField( + max_length=2, + choices=MEDIA_TYPES, + default='mo', + ) + +class CommonMediaFields(models.Model): + name = models.CharField('Title', maxlength=256) + media_type = models.ForeignKey('MediaType') + summary = models.TextField('Summary') + release_date = models.DateField('Release Date') + creation_date = models.DateTimeField('Added Date', auto_now_add=True) + updated_date = models.DateTimeField('Updated Date', auto_now=True) + original_language = models.CharField('Original Language') + class Meta: + abstract = True + +class VideoFields(CommonFields): + tmdb_id = models.PositiveIntegerField('TheMovieDB ID') + imdb_id = models.PositiveIntegerField('IMDB ID') + tmdb_rating = models.PositiveIntegerField('TheMovieDB rating', max_value=100) + mc_rating = models.PositiveIntegerFrield('MetaCritic Rating', max_value=100) + class Meta: + abstract = True + +class Genres(models.Model): + media = models.ForeignKey('MediaTypes') + genre = models.CharFields('Genre') + +class MediaStatus(models.Model): + media = models.ForeignKey('MediaTypes') + status = models.CharFields('Status') diff --git a/managemedia/models/models.py b/managemedia/models/models.py new file mode 100644 index 0000000..a795340 --- /dev/null +++ b/managemedia/models/models.py @@ -0,0 +1,60 @@ +from django.db import models + +class MediaTypes(models.Model): + name = models.CharField('Title') + +class CommonMediaFields(models.Model): + name = models.CharField('Title', maxlength=256) + summary = models.TextField('Summary') + release_date = models.DateField('Release Date') + creation_date = models.DateTimeField('Added Date', auto_now_add=True) + updated_date = models.DateTimeField('Updated Date', auto_now=True) + original_language = models.CharField('Original Language') + class Meta: + abstract = True + +class VideoFields(CommonFields): + tmdb_id = models.PositiveIntegerField('TheMovieDB ID') + imdb_id = models.PositiveIntegerField('IMDB ID') + tmdb_rating = models.PositiveIntegerField('TheMovieDB rating', max_value=100) + mc_rating = models.PositiveIntegerFrield('MetaCritic Rating', max_value=100) + class Meta: + abstract = True + +class Genres(models.Model): + media = models.ForeignKey('MediaTypes') + genre = models.CharFields('Genre') + +class MediaStatus(models.Model): + media = models.ForeignKey('MediaTypes') + status = models.CharFields('Status') + +class Film(VideoFields): + original_title = models.CharField('Original Title', maxlength=256) + tagline = modelx.CharField('Tagline') + runtime = models.PositiveIntegerField('Total Runtime') + cover = models.ImageField('Cover Image') + backdrop = models.ImageField('Backdrop Image') + rt_rating = models.PositiveIntegerField('Rotten Tomatoes Rating', max_value=100) + am_rating = models.DecimalField('AllMovie Rating', max_digits=3, decimal_places=1) + +class FilmAltTitles(models.Model): + film = models.ForeignKey('Film', on_delete=models.CASCADE) + title = models.CharField('Title') + country = models.CharField('Country') + type = models.CharField('Type') + +class FilmGenres(models.Model): + film = models.ForeignKey('Film', on_delete=models.CASCADE) + genre = models.ForeignKey('Genres', on_delete=models.CASCADE) + +class VGames(CommonMediaFields) + tgdb_id = models.PositiveIntegerField('TheGamesDB ID') + platform = models.ForeignKey('Platform') + developer = models.CharField('Developers') + publisher = models.CharField('Publishers') + cover = models.ImageField('Cover Image') + players = models.PositiveIntegerField('Players') + coop = models.BooleanField('Co-Op') + + diff --git a/managemedia/models/movies.py b/managemedia/models/movies.py new file mode 100644 index 0000000..b445869 --- /dev/null +++ b/managemedia/models/movies.py @@ -0,0 +1,19 @@ +class Film(VideoFields): + original_title = models.CharField('Original Title', maxlength=256) + tagline = modelx.CharField('Tagline') + runtime = models.PositiveIntegerField('Total Runtime') + cover = models.ImageField('Cover Image') + backdrop = models.ImageField('Backdrop Image') + rt_rating = models.PositiveIntegerField('Rotten Tomatoes Rating', max_value=100) + am_rating = models.DecimalField('AllMovie Rating', max_digits=3, decimal_places=1) + +class FilmAltTitles(models.Model): + film = models.ForeignKey('Film', on_delete=models.CASCADE) + title = models.CharField('Title') + country = models.CharField('Country') + type = models.CharField('Type') + +class FilmGenres(models.Model): + film = models.ForeignKey('Film', on_delete=models.CASCADE) + genre = models.ForeignKey('Genres', on_delete=models.CASCADE) + diff --git a/managemedia/models/tv.py b/managemedia/models/tv.py new file mode 100644 index 0000000..e69de29 diff --git a/managemedia/models/vgames.py b/managemedia/models/vgames.py new file mode 100644 index 0000000..92ed872 --- /dev/null +++ b/managemedia/models/vgames.py @@ -0,0 +1,9 @@ +class VGames(CommonMediaFields) + tgdb_id = models.PositiveIntegerField('TheGamesDB ID') + platform = models.ForeignKey('Platform') + developer = models.CharField('Developers') + publisher = models.CharField('Publishers') + cover = models.ImageField('Cover Image') + players = models.PositiveIntegerField('Players') + coop = models.BooleanField('Co-Op') + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..cba02d5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +django-mysql +pillow