now using wtforms for fields, formatting is still not right with bootstrap4, but it will have to do
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
__pycache__/
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8
author.py
Normal file
8
author.py
Normal 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
9
templates/authors.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<html>
|
||||
<body>
|
||||
|
||||
<h1>authors</h1>
|
||||
{% for author in authors %}
|
||||
<p>{{author.surname}}, {{author.firstnames}}</p>
|
||||
{% endfor %}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user