Skip to content
Snippets Groups Projects
Unverified Commit f145d2b0 authored by Bence Csókás's avatar Bence Csókás
Browse files

Házi: törlés

parent 96f30bc8
No related branches found
No related tags found
No related merge requests found
Pipeline #760 canceled
......@@ -77,5 +77,13 @@ def resolve_task(task_id):
# Feladatotok az elemtörlés megvlósítása.
@app.route('/del/<int:task_id>')
def del_task(task_id):
task = Task.query.get(task_id)
if task:
db.session.delete(task)
db.session.commit()
return redirect('/')
if __name__ == '__main__':
app.run()
......@@ -16,7 +16,7 @@
{% if task.done %} <strike> {% endif %}{{ task.content }} {% if task.done %} </strike>{% endif %}
<!-- Hozzunk létre egy linket ami meghívja a task id-ját -->
<a href="/done/{{ task.id }}">X</a>
&nbsp;<a href="/del/{{ task.id }}">delete</a>
</li>
<!-- Zárjuk le a for-t -->
{% endfor %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment