now using wtforms for fields, formatting is still not right with bootstrap4, but it will have to do

This commit is contained in:
2020-11-13 17:07:02 +11:00
parent 4d9a2fc7b1
commit db47770720
8 changed files with 18 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
__pycache__/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

8
author.py Normal file
View File

@@ -0,0 +1,8 @@
from wtforms import SubmitField, StringField, HiddenField, validators, Form
class AuthorForm(Form):
id = HiddenField()
firstnames = StringField('FirstName(s):', [validators.DataRequired()])
surname = StringField('Surname:', [validators.DataRequired()])
submit = SubmitField('Save' )

9
templates/authors.html Normal file
View File

@@ -0,0 +1,9 @@
<html>
<body>
<h1>authors</h1>
{% for author in authors %}
<p>{{author.surname}}, {{author.firstnames}}</p>
{% endfor %}
</body>
</html>