コンテンツにスキップ
per page, with , order by , clip by
Results of 1 - 1 of about 1 for parameterize (0.001 sec.)
Advanced Dependencies 9414
Advanced Dependencies Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . Parameterized dependencies All the dependencies we have seen are a fixed function or class. B ... t we want to have a dependency that checks if the query parameter q contains some fixed content. But we want to be able to parameterize that fixed content. A "callable" instance In Python there's a way to make an instance of a class a "callable". Not the cla ... sub-dependencies, and this is what will be called to pass a value to the parameter in your path operation function later. Parameterize the instance And now, we can use __init__ to declare the parameters of the instance that we can use to "parameterize" the ... d : bool = Depends ( checker )): return { "fixed_content_in_query" : fixed_content_included } And that way we are able to "parameterize" our dependency, that now has "bar" inside of it, as the attribute checker.fixed_content . Use the instance as a dependenc ...
https://man.mtool.work/fastapi/0.115/advanced/advanced-dependencies/
PREV 1 NEXT