made it possible to skip a certain person

parent 0209010a
......@@ -18,7 +18,7 @@ class Person:
return self.name
def __eq__(self, other):
return self.name == other.name
return self.name.lower() == other.name.lower()
def getStatus(self):
return self.statusses[self.status]
......@@ -41,12 +41,14 @@ def home():
return render_template("home.html", people=people)
@app.route("/statusUpdate")
@app.route("/statusUpdate", methods=["POST", "GET"])
def statusUpdate():
if people:
people[0].status += 1
if people[0].status == 3:
people.remove(people[0])
if people and request.method == "POST":
index = people.index(Person(request.form["name"]))
print(index)
people[index].status += 1
if people[index].status == 3:
people.remove(people[index])
return redirect("/")
......
......@@ -14,16 +14,16 @@
<p><input type="submit" value="Persoon toevoegen"></p>
</form>
<form action="/statusUpdate" method="POST">
<p>Up te daten persoon <input type="text" name="name"></p>
<p><input type="submit" value="Updaten"></p>
</form>
<h2>Zie hieronder de lijst van personen die een pannenkoek willen</h2>
<table>
{% for person in people %}
<tr>
<th>{{ person.getName() + person.getRemark() + ": " }}</th>
<td>
<a href="/statusUpdate">
<input type="button" value="{{ person.nextStatus() }}"/>
</a>
</td>
<td>{{ "Huidige status: " + person.getStatus() }}</td>
</tr>
{% endfor %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment