def get_filter_values(table, column): if table == 'groups': values = MongoDBConnection.get_groups_collection().distinct(column) elif table == 'students': values = MongoDBConnection.get_students_collection().distinct(column) elif table == 'test': values = MongoDBConnection.get_tests_collection().distinct(column) elif table == 'saved_state': values = MongoDBConnection.get_saved_state_collection().distinct( column) elif table == 'games': values = MongoDBConnection.get_games_collection().distinct(column) elif table == 'chapters': values = MongoDBConnection.get_chapters_collection().distinct(column) elif table == 'events': values = MongoDBConnection.get_events_collection().distinct(column) elif table == 'decisions': values = MongoDBConnection.get_decisions_collection().distinct(column) try: values = list(map(int, values)) return [min(values), max(values)] except: return values
def get_games(): games = MongoDBConnection.get_games_collection().find({}) return games