jinja2-fragments #52
-
Very helpful library, I have maybe stupid questions, can this library works with jinja2-fragments. And how forms and forms input values are handled as well. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi, Not a stupid question at all. I think it was already asked both here and on Reddit.
I'm not sure what you mean by "how forms ... are handled". Do you mind if I convert this issue into a discussion? That way maybe others will also be more encouraged to join the conversion and help you. |
Beta Was this translation helpful? Give feedback.
-
Hi volfpeter thank you for the quick response. I would like to follow this pattern Template Fragments |
Beta Was this translation helpful? Give feedback.
Notice that the usage example from your comment does not require any change to the
fasthx
API. So I'll refer back to my original response:If you also have a look at the FastAPI integration of
jinja2-segments
, you will immediately see that it's done by sub-classingJinja2Templates
, which means you can usejinja2-segments
withfasthx
out of the box, you just need to pass aJinja2Blocks
instance tofasthx.Jinja
, instead offastapi.templating.Jinja2Templates
.