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

Loading…
Cancel
Save