Add photo support
Committed 5d0886
--- a/webint_owner/__init__.py
+++ b/webint_owner/__init__.py
@app.query
-def update_details(db, name=None, nickname=None, note=None, uid="/"):
+def update_details(db, name=None, photo=None, nickname=None, note=None, uid="/"):
"""Update name of identity with given `uid`."""
card = db.select(
"identities",
)[0]["card"]
if name:
card["name"] = [name]
+ if photo:
+ card["photo"] = [photo]
if nickname:
card["nickname"] = [nickname]
if note:
def post(self):
"""Update owner information."""
- form = web.form("name", "nickname", "note")
- app.model.update_details(form.name, form.nickname, form.note)
+ form = web.form("name", "photo", "nickname", "note")
+ app.model.update_details(form.name, form.photo, form.nickname, form.note)
raise web.SeeOther("/owner")
--- a/webint_owner/templates/index.html
+++ b/webint_owner/templates/index.html
<input type=text readonly value="$tx.origin"></div>
<div><label>Name<br>
<input type=text name=name value="$get('name')[0]"></div>
+<div><label>Photo<br>
+<input type=text name=photo value="$get('photo')[0]"></div>
<div><label>Nickname<br>
<input type=text name=nickname value="$get('nickname')[0]"></div>
<div><label>Note<br>