mirror of
https://github.com/sigmasternchen/Diary
synced 2025-03-15 07:08:56 +00:00
Added a form for adding entries
This commit is contained in:
parent
7cb9335c0a
commit
62624c9f57
2 changed files with 5 additions and 1 deletions
|
@ -69,7 +69,7 @@ def addentry(name=''):
|
|||
e=Entry(d.id,request.form['text'])
|
||||
db.add(e)
|
||||
db.commit()
|
||||
return 'success'
|
||||
return redirect(url_for('diary',name=name))
|
||||
|
||||
if __name__=='__main__':
|
||||
app.debug=True
|
||||
|
|
|
@ -8,6 +8,10 @@
|
|||
</head>
|
||||
<body>
|
||||
<p>{{ diary.name }}:</p>
|
||||
<form action="{{ url_for('addentry',name=diary.name) }}" method="POST">
|
||||
<input type="textarea" name="text" autofocus>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
<div>
|
||||
{% for e in entries %}
|
||||
<p>
|
||||
|
|
Loading…
Reference in a new issue