class CreateLeague(object): def __init__(self, league_name, league_owner, start_date, end_date, end_record): self.league_name = league_name self.league_owner = league_owner self.start_date = start_date self.end_date = end_date self.end_record = end_record self.db = InteractWithMovieDb() def create_league(self): self.db.add_league_to_leagues(self.league_name, self.league_owner, self.start_date, self.end_date, self.end_record) self.db.create_league_movie_table(self.league_name) self.db.create_league_table(self.league_name) def check_date(self): pass def check_league_name(self): pass def check_league_owner(self): pass
def create_league(league_name, league_owner, start_date, end_date, end_record): print 'hi' db = InteractWithMovieDb() udb = InteractWithUsersDb() uid = udb.get_user_info(league_owner)[0][0] print 'hi1' league_name = league_name.replace(" ", "_") print 'hi2' print league_name, uid, str(start_date), str(end_date), str(end_record) db.add_league_to_leagues(league_name, uid, str(start_date), str(end_date), str(end_record)) print 'hi3' db.create_league_movie_table(league_name) print 'hi4' db.create_league_table(league_name) print 'hi5' db.create_league_user_table(league_name) print 'hi6' db.add_user_to_league_user(league_name, int(uid)) print 'hi7' # populate league_movies #gml = GetMovieList(league_name) #gml.get_date_range() tasks.get_date_range(league_name) print 'hi'