Esempio n. 1
0
	def get(self, playerguess):
		playername = extractOne(playerguess, playerdict)[0]
		data = fixer([d.__dict__ for d in Players.query.filter_by(PLAYER_NAME=playername)])
		return jsonify({playername: data})
Esempio n. 2
0
	def get(self, teamguess):
		teamname = extractOne(teamguess, teamdict)[0]
		data = fixer([d.__dict__ for d in Teams.query.filter_by(TEAM_NAME=teamname)])
		return jsonify({teamname: data})
Esempio n. 3
0
	def get(self, playerid):
		if playerid not in playerdict:
			return jsonify({'ERROR': 'ID NOT FOUND'})
		else:
			data = fixer([d.__dict__ for d in Players.query.filter_by(PLAYER_ID=playerid)])
			return jsonify({'Player ID Result': data})
Esempio n. 4
0
	def get(self, teamid):
		if teamid not in teamdict:
			return jsonify({'ERROR': 'ID NOT FOUND'})
		else:
			data = fixer([d.__dict__ for d in Teams.query.filter_by(TEAM_ID=teamid)])
			return jsonify({'Team ID Result': data})
Esempio n. 5
0
	def get(self):
		players = fixer([p.__dict__ for p in Players.query.all()])
		return jsonify({'NBA Players': players})
Esempio n. 6
0
	def get(self):
		
		teams = fixer([t.__dict__ for t in Teams.query.all()])
		return jsonify({'NBA Teams': teams})