diff --git a/__pycache__/config.cpython-35.pyc b/__pycache__/config.cpython-35.pyc new file mode 100644 index 0000000..8420f45 Binary files /dev/null and b/__pycache__/config.cpython-35.pyc differ diff --git a/__pycache__/contextualise.cpython-35.pyc b/__pycache__/contextualise.cpython-35.pyc new file mode 100644 index 0000000..e34a272 Binary files /dev/null and b/__pycache__/contextualise.cpython-35.pyc differ diff --git a/__pycache__/forms.cpython-35.pyc b/__pycache__/forms.cpython-35.pyc new file mode 100644 index 0000000..dd18974 Binary files /dev/null and b/__pycache__/forms.cpython-35.pyc differ diff --git a/contextualise.py b/contextualise.py index 6091f79..9fbd14a 100644 --- a/contextualise.py +++ b/contextualise.py @@ -73,9 +73,8 @@ def all(): return render_template('all.html', file=thefile, listingfiles=listingfiles, jsonfiles=jsonfiles, listofdicts=listofdicts, counter2=counter2) -@app.route('/description', methods=['GET', 'POST']) +@app.route('/description') def description(): - form = ReusableForm(request.form) #pick a file but that will be done an other way later thefile = listingfiles[positioninarray] #select one file from fullpath minus static/ @@ -96,29 +95,10 @@ def description(): Your browser does not support the video tag. ''') - print (form.errors) - if request.method == 'POST' and form.validate(): - return 'Success!' # return render_template('description.html', form=form, file=thefile, listingdirectories=listingdirectories, listingfiles=listingfiles) - return render_template('description.html', form=form, file=thefile) + return render_template('description.html', file=thefile) -@app.route('/get-data', methods=['GET', 'POST']) -def savepost(): - if request.method=='POST': - dict={'id':listingdirectories[positioninarray][13:],'name':request.form['name'],'email':request.form['email'],'friend':request.form['friend'],'content':request.form['content']} - # open with "a" if the file should concatenate content - - #json file naming gone unique by adding time and date of submission - - with open(listingdirectories[positioninarray]+"/"+now+"_data_file.json", "w") as write_file: - json.dump(dict, write_file) - return "The JSON file is ready." - #throw description and next item, wee need to iterate through the files - - else: - return "Error" - if __name__ == '__main__': app.run(debug=True) diff --git a/templates/description.html b/templates/description.html index bb2fbfa..2aa13f1 100644 --- a/templates/description.html +++ b/templates/description.html @@ -17,19 +17,5 @@ {% endfor %} --> - {% for message in form.name.errors %} -
{{ message }}
- {% endfor %} - -
-
- {{ form.hidden_tag() }} -
{{ form.name.label }} {{ form.name }}
-
{{ form.email.label }} {{ form.email }}
-
{{ form.friend.label }} {{ form.friend }}
-
{{ form.content.label }} {{ form.content }}
-
{{ form.submit }}
-
-
{% endblock %} diff --git a/templates/layout.html b/templates/layout.html index 8caf8e6..9a1bb06 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -13,7 +13,7 @@