alternative way to make author_text

master
Michael Murtaugh 4 years ago
parent cba289c3b2
commit cc5ff4e008

@ -36,6 +36,15 @@ for book in session.query(Book).all():
all_authors = [author.name for author in book.authors]
glued_together = format_string.format(", ".join(all_authors))
# ALTERNATIVE WAY... (without list comprehensions)
first = True
author_text = ""
for author in book.authors:
if not first:
text += ", "
author_text += "<font size=12>{}</font>".format(author.name)
first = False
#if all_authors==['John Markoff']:
# import ipdb; ipdb.set_trace()

Loading…
Cancel
Save