问题
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