Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
6012CEM_Movie_Club/api/models.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
27 lines (24 sloc)
1.7 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from . import db | |
class MOVIE_DETAILS(db.Model): | |
id = db.Column(db.Integer, primary_key=True, unique=True, nullable=False, autoincrement=True) | |
title = db.Column(db.String(50), nullable=False) | |
release = db.Column(db.Integer, nullable=False) | |
description = db.Column(db.String(500), nullable=False) | |
rating = db.Column(db.Integer, nullable=False) #this class imports the MOVIE_DETAILS columns from the database | |
movieLength = db.Column(db.String(50), nullable=False) | |
category = db.Column(db.String(50), nullable=False) | |
coverPhoto = db.Column(db.String(100), nullable=False) | |
pagePhoto = db.Column(db.String(100), nullable=False) | |
longDescription = db.Column(db.String(500), nullable=False) | |
class USER_DETAILS(db.Model): | |
id = db.Column(db.Integer, primary_key=True, unique=True, nullable=False, autoincrement=True) | |
userName = db.Column(db.String(64), nullable=False) | |
userPassword = db.Column(db.String(64), nullable=False) #this class imports the USER_DETAILS columns from the database | |
joinDate = db.Column(db.String(64), nullable=False) | |
class REVIEW_DETAILS(db.Model): | |
reviewId = db.Column(db.Integer, primary_key=True, unique=True, nullable=False, autoincrement=True) | |
movieId = db.Column(db.Integer, db.ForeignKey('MOVIE_DETAILS.id'), nullable=False) #this class imports the REVIEW_DETAILS columns from the database | |
userId = db.Column(db.Integer, db.ForeignKey('USER_DETAILS.id'), nullable=False) | |
rating = db.Column(db.Integer, nullable=False) | |
review = db.Column(db.String(500), nullable=False) | |
reviewDate = db.Column(db.String(50), nullable=False) |