Guest User

Untitled

a guest
Sep 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <ul>
  2. {% for x in lk1 %}
  3. <li><a href="{{ url_for('bookPage'}}">{{ x[2] }} (by) {{ x[3] }} (year) : {{ x[4] }}</a></li>
  4. {% endfor %}
  5. </ul>
  6.  
  7. <ul>
  8. {% for x in lk1 %}
  9. <li><a href="{{ url_for('bookPage', title=x[2] }}">{{ x[2] }} (by) {{ x[3] }} (year) : {{ x[4] }}</a></li>
  10. {% endfor %}
  11. </ul>
  12.  
  13. @app.route('/books/<title>' )
  14. # the name of this function have to be used in
  15. # url_for ('nameOfFunction', name_of_variable_part_of_url=some_internal_variable)
  16. def bookPage(isbn):
  17. # code, that will creat yourlist
  18. # book.html - template for book
  19. # listofvariables - variables for book's page
  20. #
  21. return render_template ("book.html", listofvariables=yourlist)
Add Comment
Please, Sign In to add comment