initial views
parent
b016a4c649
commit
9eb2aa31ae
Binary file not shown.
Binary file not shown.
|
@ -54,7 +54,7 @@ ROOT_URLCONF = 'keymedia.urls'
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
{
|
{
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||||
'DIRS': [],
|
'DIRS': [os.path.join(BASE_DIR, "templates")],
|
||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
'context_processors': [
|
'context_processors': [
|
||||||
|
|
|
@ -3,6 +3,5 @@ from django.urls import include,path
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path('admin/', admin.site.urls),
|
path('admin/', admin.site.urls),
|
||||||
path('managemedia/', include('managemedia.urls',)),
|
path('manage/', include('managemedia.urls',)),
|
||||||
path('profile/', include('listmedia.urls')),
|
|
||||||
]
|
]
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,5 @@
|
||||||
|
from .books import *
|
||||||
|
from .common import *
|
||||||
|
from .movies import *
|
||||||
|
from .tv import *
|
||||||
|
from .vgames import *
|
|
@ -24,7 +24,7 @@ class CommonMediaFields(models.Model):
|
||||||
original_language = models.CharField('Original Language', blank=True)
|
original_language = models.CharField('Original Language', blank=True)
|
||||||
class Meta:
|
class Meta:
|
||||||
abstract = True
|
abstract = True
|
||||||
|
|
||||||
### VideoFields is for movies and tv shows
|
### VideoFields is for movies and tv shows
|
||||||
class VideoFields(CommonFields):
|
class VideoFields(CommonFields):
|
||||||
tmdb_id = models.PositiveIntegerField('TheMovieDB ID', blank=True)
|
tmdb_id = models.PositiveIntegerField('TheMovieDB ID', blank=True)
|
||||||
|
|
|
@ -1,60 +0,0 @@
|
||||||
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')
|
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
|
||||||
class Film(VideoFields):
|
class Movies(VideoFields):
|
||||||
original_title = models.CharField('Original Title', maxlength=256, blank=True)
|
original_title = models.CharField('Original Title', maxlength=256, blank=True)
|
||||||
tagline = models.CharField('Tagline', blank=True)
|
tagline = models.CharField('Tagline', blank=True)
|
||||||
runtime = models.PositiveIntegerField('Total Runtime', blank=True)
|
runtime = models.PositiveIntegerField('Total Runtime', blank=True)
|
||||||
rt_rating = models.PositiveIntegerField('Rotten Tomatoes Rating', max_value=100, blank=True)
|
rt_rating = models.PositiveIntegerField('Rotten Tomatoes Rating', max_value=100, blank=True)
|
||||||
am_rating = models.DecimalField('AllMovie Rating', max_digits=3, decimal_places=1, blank=True)
|
am_rating = models.DecimalField('AllMovie Rating', max_digits=3, decimal_places=1, blank=True)
|
||||||
|
|
||||||
class FilmAltTitles(models.Model):
|
class MovieAltTitles(models.Model):
|
||||||
film = models.ForeignKey('Film', on_delete=models.CASCADE)
|
film = models.ForeignKey('Movies', on_delete=models.CASCADE)
|
||||||
title = models.CharField('Title')
|
title = models.CharField('Title')
|
||||||
country = models.CharField('Country')
|
country = models.CharField('Country')
|
||||||
title_type = models.CharField('Type', blank=True)
|
title_type = models.CharField('Type', blank=True)
|
||||||
|
|
||||||
class FilmGenres(models.Model):
|
class MovieGenres(models.Model):
|
||||||
film = models.ForeignKey('Film', on_delete=models.CASCADE)
|
movie = models.ForeignKey('Movies', on_delete=models.CASCADE)
|
||||||
genre = models.ForeignKey('Genres', on_delete=models.CASCADE)
|
genre = models.ForeignKey('Genres', on_delete=models.CASCADE)
|
||||||
|
|
||||||
|
|
|
@ -2,3 +2,7 @@ from django.http import HttpResponse
|
||||||
|
|
||||||
def index(request):
|
def index(request):
|
||||||
return HttpResponse("Hello, ur at managemedia")
|
return HttpResponse("Hello, ur at managemedia")
|
||||||
|
|
||||||
|
def view_movie(request, movie_id):
|
||||||
|
response = "You're looking at movie ID %s."
|
||||||
|
return HttpResponse(response % movie_id)
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
django-mysql
|
django-mysql
|
||||||
|
django-postgresql
|
||||||
pillow
|
pillow
|
||||||
|
|
Loading…
Reference in New Issue