status of current meal is read from database

master
Marek Baczynski 7 years ago
parent a8666c1212
commit e8d8bdb530

@ -104,6 +104,10 @@ class Meal(object):
Person.get(eater).kukPoints += points / eaterCount Person.get(eater).kukPoints += points / eaterCount
print "+{} gets {} points ".format(eater, points / eaterCount) print "+{} gets {} points ".format(eater, points / eaterCount)
@staticmethod
def getCurrent():
return mealHistory[max(mealHistory.keys())]
@staticmethod @staticmethod
def getNextMID(): def getNextMID():
if len(mealHistory) == 0: if len(mealHistory) == 0:
@ -156,12 +160,13 @@ login_manager.login_view = "login"
@app.route("/") @app.route("/")
@login_required @login_required
def index(): def index():
meal = Meal.getCurrent()
cook = {} cook = {}
cook['name'] = 'Ahmed' cook['name'] = meal.kuk
cook['confirmed'] = 'no' cook['confirmed'] = 'yes'
eaters = ['Marek', 'Davide', 'Sven'] return render_template('index.html', leaderboard=Person.leaderboard(), cook=cook, eaters=meal.eaters)
return render_template('index.html', leaderboard=Person.leaderboard(), cook=cook, eaters=eaters)
# somewhere to login # somewhere to login
@app.route("/login", methods=["GET", "POST"]) @app.route("/login", methods=["GET", "POST"])

Loading…
Cancel
Save