How do I prepare query in view before passing it to Jinja?

笑着哭i 提交于 2021-01-29 18:24:54

问题


Let's say I have table users with column id and fullname. In my HTML, I want to have a for loop to display the id and the result of fullname after I pass it into a function called func. I don't want to pass func into Jinja because it requires importing certain module. So, I think I need to pass fullname into func in view.

My question is what is the best way to do this? Do I need to make a new table just for this to later pass it into Jinja? So far this seems like the only solution that I can think of but it feels a bit overkill.

来源:https://stackoverflow.com/questions/62840030/how-do-i-prepare-query-in-view-before-passing-it-to-jinja

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!