Get image

This commit is contained in:
Emmanuelle Helly 2018-10-04 17:35:16 +02:00
parent 70e08e1a0a
commit b3b78cfd4f
2 changed files with 5 additions and 1 deletions

View File

@ -104,11 +104,15 @@ def save_post(category, timestamp, admin, form, files):
post = get_path(category, status, timestamp, BASE_FILE, create_dir=True)
tree = ElementTree.Element('entry')
for key, value in form.items():
if key.startswith('_'):
continue
if key == 'image':
print(files)
element = ElementTree.SubElement(tree, key)
element.text = value
element = ElementTree.SubElement(tree, STATE_PUBLISHED)
element.text = email.utils.formatdate(
int(timestamp) if timestamp else time.time()

View File

@ -23,7 +23,7 @@
{% block main %}
<article>
<form method="post">
<form method="post" enctype="multipart/form-data">
<label>Titre
<input name="title" value="{{ post.title }}" />
</label>