|
|
|
|
@ -1,3 +1,23 @@
|
|
|
|
|
"""main flask app routes
|
|
|
|
|
|
|
|
|
|
There are two types of routes, first the static routes :
|
|
|
|
|
|
|
|
|
|
- /
|
|
|
|
|
- /about
|
|
|
|
|
- /actes
|
|
|
|
|
- /contact
|
|
|
|
|
- /privacy
|
|
|
|
|
- /termsofservice
|
|
|
|
|
|
|
|
|
|
Then the dynamic routes :
|
|
|
|
|
|
|
|
|
|
- /actes
|
|
|
|
|
- /actes/<house>
|
|
|
|
|
- /actes/<house>/<prince>
|
|
|
|
|
- /acte/<house>/<prince>/<dateitem>
|
|
|
|
|
- /geoloc
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
import typing as t
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -54,13 +74,13 @@ def actes(house):
|
|
|
|
|
# prince_code = act['prince_code'].capitalize()
|
|
|
|
|
# if (prince_name, prince_code) not in princes:
|
|
|
|
|
# princes.append((prince_name, prince_code))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sample result:
|
|
|
|
|
# [('Louis II de Bourbon', 'lo_ii'), ('Anne Dauphine', 'ann_i'), ('Agnès de Bourgogne', 'agn_i'), ('Charles Ier de Bourbon', 'ch_i')]
|
|
|
|
|
# [('Agnès de Bourgogne', 'agn_i'), ('Anne Dauphine', 'ann_i'), ('Charles Ier de Bourbon', 'ch_i'), ('Louis II de Bourbon', 'lo_ii')
|
|
|
|
|
princes = princes_in_houses[house]
|
|
|
|
|
# TODO : modify the jinja template and suppress this line
|
|
|
|
|
|
|
|
|
|
# TODO : modify the jinja template's design in order to suppress this ugly line
|
|
|
|
|
princes = [(prc['prince_name'], prc['prince_code']) for prc in princes]
|
|
|
|
|
# [('Agnès de Bourgogne', 'agn_i'), ('Anne Dauphine', 'ann_i'), ('Charles Ier de Bourbon', 'ch_i'), ('Louis II de Bourbon', 'lo_ii')
|
|
|
|
|
return render_template("corpus.html", house=house.capitalize(), princes=princes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|