Hello, I call a function in my template that returns sqlalchemy query result, (color value from the name of the tag). this is the query function :
*def get_tag_color(name): * *return db.session.query(Tag.tag_color).filter(Tag.tag_name == name).scalar() * and I call it in my template file: * {% if server.tags %}* * {% for tag in server.tags.split(",") %} * * <strong><span style="background-color: {{ get_tag_color(tag) }};" class="label"> {{tag}} </span></strong>* * {% endfor %} {% endif %} * the problem is that I get just one result of the first tag. do you have any idea what I miss? Thank you -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/4f9d1bab-479d-47d5-89cf-c305026ec3d7n%40googlegroups.com.