def newGame(genre_id): if 'username' not in login_session: return redirect('/loggingIn') if request.method == 'POST': if request.form['name'] == "": flash("Can't leave field empty!") return redirect(url_for('exploreGenre', genre_id=genre_id)) elif request.form['esrb'] == "": flash("Can't leave field empty!") return redirect(url_for('exploreGenre', genre_id=genre_id)) elif request.form['releaseYear'] == "": flash("Can't leave field empty!") return redirect(url_for('exploreGenre', genre_id=genre_id)) elif request.form['platforms'] == "": flash("Can't leave field empty!") return redirect(url_for('exploreGenre', genre_id=genre_id)) elif request.form['desc'] == "": flash("Can't leave field empty!") return redirect(url_for('exploreGenre', genre_id=genre_id)) else: newGame = Game() newGame.name = request.form['name'] newGame.esrb = request.form['esrb'] newGame.releaseYear = request.form['releaseYear'] newGame.platforms = request.form['platforms'] newGame.desc = request.form['desc'] newGame.genreID = genre_id newGame.user_id = login_session['user_id'] session.add(newGame) session.commit() return redirect(url_for('exploreGenre', genre_id=newGame.genreID)) else: return render_template('newGame.html', genre_id=genre_id)
def newGame(): if 'username' not in login_session: return redirect('/login') consoles = session.query(Console).all() genres = session.query(Genre).all() if request.method == 'POST': newGame = Game(name=request.form['name'], user_id=login_session['user_id'], description=request.form['description'], ageRating=request.form['ageRating'], price=request.form['price'], image=request.form['image']) session.add(newGame) flash('New Game %s Successfully Created' % newGame.name) session.commit() gameObj = session.query(Game).order_by(Game.id.desc()).first() multiselect = request.form.getlist('console') for x in multiselect: newInventory = Inventory(name=request.form['name'], game_id=gameObj.id, console=x, genre=request.form['genre'], user_id=login_session['user_id']) session.add(newInventory) session.commit() return redirect(url_for('showGames')) else: return render_template('newGame.html', consoleList=consoles, genreList=genres)
def addgame(): data=request.get_json() game = Game( name=data['name'], category=data['category']) session.add(game) session.commit() return jsonify({'message':'new game Added'})
def Add(category_id): if 'username' not in login_session: return redirect('/login') if request.method == 'POST': newGame = Game(name=request.form.get('name', False), description=request.form.get('description', False), category_id=request.form.get('categories_id', False)) session.add(newGame) session.commit() return redirect(url_for('categories', category_id=category_id)) else: return render_template('Add.html', category_id=category_id)
def newGame(): if 'username' not in login_session: return redirect('/login') if request.method == 'POST': newGame = Game(name=request.form['name'], user_id=login_session['user_id']) session.add(newGame) flash('New Game %s Successfully Created' % newGame.name) session.commit() return redirect(url_for('showGames')) else: return render_template('newGame.html')
def add_game(): if request.method == 'GET': return render_template('add_game.html') if request.method == 'POST': print(request.form) game = Game(name=request.form['name'], description=request.form['description'], category_id=request.form['category'], user_id=login_session['user_id']) session.add(game) session.commit() flash("New game added!", 'success') return redirect(url_for('get_games'))
def newgame(console_id): console = session.query(Console).filter_by(id=console_id).one() if 'username' not in login_session: return redirect('/login') if request.method == 'POST': newGame = Game(name=request.form['name'], date=request.form['date'], type=request.form['type'], developer=request.form['developer'], console_id=console_id, user_id=console.user_id) session.add(newGame) session.commit() flash("new game info created!") return redirect(url_for('showgame', console_id=console_id)) else: return render_template('newgame.html', console_id=console_id)
def newgame(genre_id): if request.method == 'POST': newItem = Game(name=request.form['name'], description=request.form['description'], price=request.form['price'], rating=request.form['rating'], platform=request.form['platform'], genre_id=genre_id, user_id=login_session['user_id']) session.add(newItem) session.commit() flash('New game {} created!'.format(newItem.name)) return redirect(url_for('showgame', genre_id=genre_id)) else: return render_template('newgame.html', genre_id=genre_id)
def newGame(category_id): if "username" not in login_session: return redirect("/login") category = session.query(Category).filter_by(id=category_id).one() if category.user_id != login_session["user_id"]: return buildUnauthorizedAlert("create", "game") if request.method == "POST": newGame = Game(name=request.form["name"], category_id=category_id) session.add(newGame) session.commit() flash("New game created!") return redirect( url_for("categories/protected/categories", category_id=category_id)) else: return render_template("games/protected/newGame.html", category_id=category_id)
def newGame(): if 'username' not in login_session: return redirect('/login') if request.method == 'POST': game_genre = session.query(GameGenre).filter_by( id=request.form['game_genre']).one() newGame = Game(user_id=login_session['user_id'], name=request.form['name'], description=request.form['description'], game_genre=game_genre) session.add(newGame) session.commit() flash('New Game %s Successfully Added' % (newGame.name)) return redirect(url_for('showHomePage')) else: game_genres = session.query(GameGenre).all() return render_template('newGame.html', game_genres=game_genres, loggedIn=userLoggedIn())
def createGame(genre_id): message = None session = DBSession() genreToAdd = session.query(Genre).filter_by(id=genre_id).one() genres, createdgenres = sideBar() if request.method == 'POST': if 'username' in login_session: name = request.form['name'] existingGame = session.query(Game ).filter_by(name=name).one_or_none() if existingGame is not None: message = "Name is already taken by another game.\ Please pick a new one" return render_template('creategame.html', genre=genreToAdd, message=message, genres=genres, createdgenres=createdgenres) elif name == "": message = "Name is empty, please provide a name" return render_template('creategame.html', genre=genreToAdd, message=message, genres=genres, createdgenres=createdgenres) else: description = request.form['description'] if description == "": description = "Creator did not provide a description...\ Thus it will forever remain a mistery.\n \ Unless you try it." newGame = Game(name=name, genre=genreToAdd, description=description, user_id=login_session['user_id']) genreToAdd.count += 1 session.add(newGame) session.add(genreToAdd) session.commit() return redirect(url_for('showGames', genre_id=genreToAdd.id)) else: return redirect(url_for('showGames', genre_id=genreToAdd.id)) else: return render_template('creategame.html', genre=genreToAdd, message=message, genres=genres, createdgenres=createdgenres)
def newGame(category_id): if 'username' not in login_session: return redirect('/category') category = session.query(Category).filter_by(id=category_id).one() if request.method == 'POST': if request.form['state'] != login_session['state']: response = make_response( json.dumps(result.get('Invalid Authorization params')), 401) response.headers['Content-Type'] = 'application/json' return response newItem = Game(name=request.form['name'], description=request.form['description'], category_id=category_id, user_id=login_session['user_id']) session.add(newItem) session.commit() return redirect(url_for('showGames', category_id=category_id)) else: return render_template('newGame.html', category=category, STATE=login_session['state'])
def createGame(developer_id): if 'username' not in login_session: return redirect('/login') developer = session.query(Developer).filter_by(id=developer_id).one() if login_session['user_id'] != developer.u_id: return redirect("/developer/" + str(developer_id) + "/") if request.method == 'POST': newGame = Game(name=request.form['name'], image=request.form['image'], gameplay=request.form['gameplay'], description=request.form['description'], d_id=developer_id, u_id=login_session['user_id']) session.add(newGame) session.commit() flash('Game Created Successfully: ' + str(newGame.name)) return redirect("/developer/" + str(developer_id)) else: return render_template('createGame.html', developer_id=developer_id, visibility=1)
def newGame(genre_id): if 'username' not in session: return redirect('/login') if request.method == 'POST': rdate = request.form['release_date'].split('-') newGame = Game(name=request.form['name'], description=request.form['description'], price=request.form['price'], developer=request.form['developer'], release_date=date(int(rdate[0]), int(rdate[1]), int(rdate[2])), platform=request.form['platform'], genre_id=genre_id, user_id=session['user_id']) dbsession.add(newGame) dbsession.commit() flash('New game created successfully!') return redirect(url_for('showGames', genre_id=genre_id)) else: genre = dbsession.query(Genre).filter_by(id=genre_id).one() return render_template('newgame.html', genre=genre)
def add_game(): # check users login status. If not logged, redirect to login page if 'username' not in login_session: return redirect('/login') if request.method == 'POST': # POST requests include all data for the new game. This data is # processed and a new game is added to the database release_date = datetime.strptime(request.form['releaseDate'], "%Y-%m-%d").date() new_game = Game(title=request.form['title'], description=request.form['description'], releaseDate=release_date, pictureURL=request.form['pictureURL'], genre_id=get_genre_id(request.form['genre'])) session.add(new_game) session.commit() flash("New game added!") return redirect(url_for('all_genres')) else: # GET request render the form for inputting the new game data genres = session.query(Genre).all() return render_template('newGame.html', genres=genres)
def newGame(publisher_id): if 'username' not in login_session: return redirect('/login') publisher = session.query(Publisher).filter_by(id=publisher_id).one() if login_session['user_id'] != publisher.user_id: return "<script>function myFunction() {alert('That's an illegal move.');}</script><body onload='myFunction()''>" if request.method == 'POST': newGame = Game(name=request.form['name'], description=request.form['description'], price=float(request.form['price']), min_players=int(request.form['min_players']), max_players=int(request.form['max_players']), min_length=int(request.form['min_length']), max_length=int(request.form['max_length']), publisher_id=publisher_id, user_id=publisher.user_id) session.add(newGame) session.commit() flash('New game "%s" Successfully Created' % (newGame.name)) return redirect(url_for('showPublisher', publisher_id=publisher_id)) else: return render_template('newgame.html', publisher_id=publisher_id)
def create_game(game_info): """Adds a game entry into the DB and return the id of the game Args: game_info: a dictionary returned by the fucntion create_game_info_dict, which contains information to be added into the DB. """ if game_info['name'] == "" or game_info['genre_id'] is None: # send a flash message here print "nononono" return None new_game = Game(name=game_info['name'], description=game_info['description'], developed_by=game_info['developed_by'], published_by=game_info['published_by'], release_date=game_info['release_date'], genre_id=game_info['genre_id'], user_id=game_info['user_id'], date_added=game_info['date_added']) session.add(new_game) session.commit() game = (session.query(Game).filter_by(name=game_info['name'], user_id=game_info['user_id']).one()) return game.id
def newGame(theme_id): if 'username' not in login_session: return redirect('/login') theme = session.query(Theme).filter_by(id=theme_id).one() # Make sure the user is the owner of the theme if login_session['user_id'] != theme.user_id: output = "" output += " <script>function myFunction() " output += " {alert('You are not authorized to add " output += " game to this theme. Please create your " output += " own theme in order to add game.');} " output += " </script><body onload='myFunction()'> " return output if request.method == 'POST': # Get the latest release date number and increment it by 1 latestgame = session.query(Game).order_by(desc(Game.release_date_number)).limit(1) number = int(latestgame[0].release_date_number) + 1 # Get the current date release_date = datetime.datetime.now().date() # Make sure the fields are not empty if request.form['name'] == '' or request.form['description'] == '': return render_template('warning.html') if request.form['img_src'] == '' or request.form['url'] == '': return render_template('warning.html') newGame = Game(name=request.form['name'], summary=request.form['description'], cover=request.form['img_src'], theme_id=theme.id, release_date_number=number, url=request.form['url'], user_id=login_session['user_id'], release_date=release_date) session.add(newGame) session.commit() flash('New Game %s Successfully Created' % (newGame.name)) return redirect(url_for('showGames', theme_id=theme.id)) else: return render_template('newgame.html', theme=theme)
def newGame(gameshop_id): if 'username' not in login_session: return redirect('/login') gameshop = session.query(Gameshop).filter_by(id=gameshop_id).one() if login_session['user_id'] != gameshop.user_id: return "<script>function myFunction()" \ "{alert('You are not authorized to add game to this " \ "gameshop. You can add games only your own gameshop!);}" \ "</script><body onload='myFunction()'>" if request.method == 'POST': # This part prevents to create empty posts. Resolved # with 'required' html validator in 'newgame.html' # if not request.form['name']: # flash('Add a name!') # return render_template('newgame.html', gameshop_id=gameshop_id) # if not request.form['description']: # flash('Add description!') # return render_template('newgame.html', gameshop_id=gameshop_id) # if not request.form['price']: # flash('Add price!') # return render_template('newgame.html', gameshop_id=gameshop_id) newGame = Game(name=request.form['name'], description=request.form['description'], price=request.form['price'], genre=request.form['genre'], gameshop_id=gameshop_id, user_id=gameshop.user_id) session.add(newGame) session.commit() flash('New Game %s Successfully Created' % (newGame.name)) return redirect(url_for('showList', gameshop_id=gameshop_id)) else: return render_template('newgame.html', gameshop_id=gameshop_id)
) session.add(user) # Add Developers and games dev = Developer( user=user, name="Codemasters Racing", image= "http://www.virtualr.net/wp-content/uploads/2012/04/codemastersracing.jpg", description= "Codemasters Software Company Ltd., or Codemasters Birmingham or CodeMasters (earlier known as Code Masters) is a British video game developer and publisher founded by David Darling and his brother Richard in 1986. Headquartered in Southam, Warwickshire, Codemasters is one of the oldest British game studios, and in 2005 was named the top independent games developer by Develop magazine." ) session.add(dev) session.add( Game(developer=dev, user=user, name="Dirt 2", image="http://data.1freewallpapers.com/detail/dirt-2.jpg")) session.add( Game( developer=dev, user=user, name="Dirt 3", image= "https://images-eds-ssl.xboxlive.com/image?url=8Oaj9Ryq1G1_p3lLnXlsaZgGzAie6Mnu24_PawYuDYIoH77pJ.X5Z.MqQPibUVTcVL1T87i_j13iJ9H7UxHFvByzHAvxHaYwF8elVl9SxjL3bhHaavB28q1GP_VcMcxH3Uq2549AKyJHSeML5I4vmPA5aWy55I4xdMPDYbTleV1UUniRcl.DXZNGA1ba0eR7r9KcSWpuD_P6B3dPDteOkrylzgaAz2K9McO74cbav9s-&format=jpg" )) session.add( Game( developer=dev, user=user, name="Dirt Rally", image=
# Create dummy user User1 = User(name="Meng", email="*****@*****.**", picture='http://mengluo.github.io/me/pics/Avatar.png') session.add(User1) session.commit() # action game genre gameGenre1 = GameGenre(name="Action Games") session.add(gameGenre1) session.commit() game1 = Game( user_id=1, name="Street Fighter", description= """Commonly abbreviated as SF or Suto, is a fighting video game franchise developed and published by Capcom. The first game in the series was released in 1987. Since then, five other main series games, as well as various spin-offs and crossovers, have been released. Street Fighter II is credited with establishing many of the conventions of the one-on-one fighting genre. The game's playable characters originate from different countries around the world, each with a unique fighting style.""", game_genre=gameGenre1) session.add(game1) session.commit() game2 = Game( user_id=1, name="Call of Duty", description= """Call of Duty is a first-person shooter video game developed by Infinity Ward and published by Activision. It is the first of many installments in the Call of Duty franchise, released on October 29, 2003, for Microsoft Windows. The game simulates infantry and combined arms warfare of World War II using a modified version of the id Tech 3 engine. Much of its theme and gameplay is similar to the Medal of Honor series; however, Call of Duty showcases multiple viewpoints staged in the British, American, and Soviet theaters of World War II.""", game_genre=gameGenre1) session.add(game2) session.commit()
name="Example User", email="*****@*****.**", picture= 'https://upload.wikimedia.org/wikipedia/commons/d/d3/User_Circle.png') session.add(user1) session.commit() #List of games for Best Games gameshop1 = Gameshop(user_id=1, name="Best Games") session.add(gameshop1) session.commit() game1 = Game(user_id=1, name="Kill'em all", description="Shoot all the enemies", price="2.99", genre="Action", gameshop=gameshop1) session.add(game1) session.commit() game2 = Game(user_id=1, name="Lost in an island", description="Survivive after a shipwreck", price="3.99", genre="Survival", gameshop=gameshop1) session.add(game2) session.commit()
Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) session = DBSession() user = User(name='Mohamed Mansour', email='*****@*****.**') session.add(user) session.commit() c1 = Category(name="Action") session.add(c1) session.commit() game1 = Game(name="Grand Theft Auto", description="""GTA games have been around for a long time, with police pursuits, gunfights, gang wars, and huge open-world environments as mainstay The games have always had intense action, with the added bonus of much of it happening at high speeds in fast cars.Since police in the game willengage the player after just a few gunshots the ability to turn on the action""" category=c1, user=user) session.add(game1) session.commit() game2 = Game(name="Assassins Creed", description="""explore historic locales all while fleeing
# session.commit(). If you're not happy about the changes, you can # revert all of them back to the last commit by calling # session.rollback() session = DBSession() # Create dummy user User1 = User(name="Mishu Goyal", email="*****@*****.**", picture='http' '://storagebythefox.com.au/wp-content/uploads/2016/11/placeholder' '.jpg') session.add(User1) session.commit() # Items for Soccer game1 = Game(user_id=1, name="Soccer") session.add(game1) session.commit() gameItem1 = GameItem(user_id=1, name="Two shinguards", description="A shin " "guard or shin pad is a piece of equipment worn on the " "front of a player's shin to protect them from injury. " "These are commonly used in sports including association " "football (soccer), baseball, ice hockey, field hockey, " "lacrosse, cricket, and other sports.", game=game1) session.add(gameItem1)
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from database_setup import Game, Base, Mcq engine = create_engine('sqlite:///Games.db') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) session = DBSession() game1 = Game(id=1, name="mcq11", category="MCQ") session.add(game1) session.commit() game2 = Game(id=2, name="mcq12", category="MCQ") session.add(game2) session.commit() game1questions1 = Mcq(id=1, game_id=1, question_body="ASD", Answer1="2", Answer2="2", Answer3="1", AnswerTrue="1") session.add(game1questions1) session.commit() game1questions2 = Mcq(id=2,
genre13 = Genre(name="Turn-based strategy") session.add(genre13) session.commit() genre14 = Genre(name="Visual Novel") session.add(genre14) session.commit() print "Added genres..." # Games by Leroy Jenkins #1 game1 = Game( user_id=1, name="World of Warcraft", description= "World of Warcraft (WoW) is a massively multiplayer online role-playing game (MMORPG) released in 2004 by Blizzard Entertainment.", genre_id=4, price="$19.99", picture="https://upload.wikimedia.org/wikipedia/en/9/91/WoW_Box_Art1.jpg") session.add(game1) session.commit() game2 = Game( user_id=1, name="Overwatch", description= "Overwatch is a team-based online multiplayer first-person shooter video game developed and published by Blizzard Entertainment.", genre_id=3, price="$39.99", picture= "https://upload.wikimedia.org/wikipedia/en/8/8f/Overwatch_cover_art_%28PC%29.jpg"
genre6 = Genre(name="Simulation", id=6) session.add(genre6) genre7 = Genre(name="Sports", id=7) session.add(genre7) genre8 = Genre(name="Strategy", id=8) session.add(genre8) session.commit() # Add action games game = Game(title="METAL GEAR SOLID V: GROUND ZEROES", description="World-renowned Kojima Productions brings the Metal " "Gear Solid franchise to Steam with METAL GEAR " "SOLID V: GROUND ZEROES. Play as the legendary hero " "Snake and infiltrate a Cuban military base to rescue " "the hostages. Can you make it out alive?", releaseDate=datetime.date(year=2014, month=12, day=18), pictureURL="http://cdn.akamai.steamstatic.com/steam/apps/" "311340/header.jpg?t=1438910624", genre_id=1) session.add(game) session.commit() game = Game(title="Grand Theft Auto V", description="When a young street hustler, a retired bank robber " "and a terrifying psychopath find themselves " "entangled with some of the most frightening and " "deranged elements of the criminal underworld, the " "U.S. government and the entertainment industry, they " "must pull off a series of dangerous heists to " "survive in a ruthless city in which they can trust "
def menu(): if 'username' in login_session: users = session.query(User) users = users.order_by(User.name.asc()) user = users.filter_by(name=login_session['username']).one() userNotification = user.notifications userGames = session.query(Game).filter((Game.player1id==user.id) | (Game.player2id==user.id)) userGames = userGames.order_by(Game.id.asc()) for game in userGames: print game.id userCompleted = session.query(Complete).filter((Complete.player1id==user.id) | (Complete.player2id==user.id)).all() userWins = session.query(Complete).filter(Complete.winnerid==user.id).all() blueWins = 0 yellowWins = 0 exitWins = 0 for win in userWins: if win.won == 'blue': blueWins += 1 elif win.won == 'yellow': yellowWins += 1 elif win.won == 'exit': exitWins += 1 if request.method == 'GET': return render_template('menu.html', playerUsername=login_session['username'], userid=user.id, users=users, userNotification=userNotification, userGames=userGames, userCompleted=userCompleted, userWins=userWins, blueWins=blueWins, yellowWins=yellowWins, exitWins=exitWins) elif request.method == 'POST': if "notifications" in request.form: notifications = request.form['notifications'] print "-->" + notifications if notifications == 'on': user.notifications = 'on' else: user.notifications = 'no' session.add(user) session.commit() flash('Email Notifications Updated') return redirect(url_for('menu')) elif "changePassword" in request.form: current_password = request.form['currentPassword'] new_password = request.form['newPassword'] confirm_password = request.form['confirmPassword'] current_hashed_password = make_secure_val(current_password) new_hashed_password = make_secure_val(new_password) if current_hashed_password == user.password: if new_password != current_password: if new_password == confirm_password: user.password = new_hashed_password session.add(user) session.commit() flash('Password Successfully Changed') return redirect(url_for('menu')) else: flash('Passwords Do Not Match') return redirect(url_for('menu')) else: flash('New Password Must Be Different Than Current Password') return redirect(url_for('menu')) else: flash('Incorrect Current Password') return redirect(url_for('menu')) elif "startExistingGame" in request.form: game_id = request.form['existingGame'] #add authentication here return redirect(url_for('game', game_id=game_id)) elif "startGame" in request.form: opponent = request.form['opponent'] date = datetime.now() new_game = Game(player1id=user.id, player2id=opponent, date=date, b11 = '', b21 = '', b31 = '', b41 = '', b51 = '', b61 = '', b12 = '', b22 = '', b32 = '', b42 = '', b52 = '', b62 = '', b13 = '', b23 = '', b33 = '', b43 = '', b53 = '', b63 = '', b14 = '', b24 = '', b34 = '', b44 = '', b54 = '', b64 = '', b15 = '', b25 = '', b35 = '', b45 = '', b55 = '', b65 = '', b16 = '', b26 = '', b36 = '', b46 = '', b56 = '', b66 = '', previousGhost='none', previousPlayer=0 ) session.add(new_game) session.commit() game_id = session.query(Game).filter_by(date=date).one().id return redirect(url_for('game', game_id=game_id)) else: flash('Please log in') return render_template('login.html')
def add_game(): # Require the user to be logged in if 'username' not in login_session: return redirect('/login') if request.method == 'POST': # Redirect home if you press Cancel if request.form['submit'] == 'Cancel': return redirect(url_for('gamerater_home')) game_name = request.form['name'] category = request.form['category'] description = request.form['description'] rating = request.form['rating'] # Double check if the game actually exists try: existing_game = get_game_by_name(game_name=game_name) flash("That game already exists! Please add a rating.") return redirect(url_for('rate_game', game_name=game_name, rating=rating)) except: # If any fields are missing return an error if not (game_name and category and description): flash('Please enter text in each field.') return render_template('add_game.html', game_name=game_name, category=category, description=description, rating=rating) # If the rating is not an integer between 0 and 10 return # an error try: rating_int = int(rating) if rating_int > 10 or rating_int < 0: flash('Please ensure the rating is a number from 1 to 10.') return render_template('rate_game.html', game_name=game_name, rating=rating) except: flash('Please ensure the rating is a number from 1 to 10.') return render_template('rate_game.html', game_name=game_name, rating=rating) # Add new game and new rating new_game = Game(name=game_name, category=category, description=description, avg_rating=rating_int, modified=datetime.now()) session.add(new_game) session.commit() game_to_rate = get_game_by_name(game_name=game_name) new_rating = UsersGames(user_id=login_session['user_id'], game_id=game_to_rate.id, rating=rating_int, modified=datetime.now()) session.add(new_rating) session.commit() flash('%s has been rated!' % game_to_rate.name) return redirect(url_for('my_games')) else: game_name = request.args.get('game_name') rating = request.args.get('rating') if not game_name: game_name = "" if not rating: rating = "" return render_template("add_game.html", game_name=game_name, rating=rating)
# revert all of them back to the last commit by calling # session.rollback() session = DBSession() User1 = User(name="Tanuj Sharma", email="*****@*****.**") session.add(User1) session.commit() category = Category(user_id=1, name="Action") session.add(category) session.commit() game = Game(user_id=1, name="Grand Theft Auto: V", description="""Grand Theft Auto V is an open-world crime epic set in the LA-inspired city of Los Santos around the lives of Franklin, a street hustler looking for real opportunities; Michael, a professional ex-con whose retirement isn't all he hoped it would be; and Trevor, a violent psychopath.""", category=category) session.add(game) session.commit() game = Game(user_id=1, name="Battlefield 1", description="""Battlefield 1 reinvents the history of warfare by taking players to World War I in this epic entry into the first-person shooter franchise. Through ever-changing environments at the dawn of all-out war, no battle is ever the same. The game takes you across multiple and varied locations in a bid to fight your way through immersive battles. From tight urban fights in a besieged French city, to big open spaces in the Italian Alps and frantic combats in the deserts of