1.9 KiB
🏧 🔗
🔗 🔗
🌐 🔗 👥 ✔️ 👀 🔧 🔢 ⚖️ 🎓.
✋️ 📤 💪 💼 🌐❔ 👆 💚 💪 ⚒ 🔢 🔛 🔗, 🍵 ✔️ 📣 📚 🎏 🔢 ⚖️ 🎓.
➡️ 🌈 👈 👥 💚 ✔️ 🔗 👈 ✅ 🚥 🔢 🔢 q
🔌 🔧 🎚.
✋️ 👥 💚 💪 🔗 👈 🔧 🎚.
"🇧🇲" 👐
🐍 📤 🌌 ⚒ 👐 🎓 "🇧🇲".
🚫 🎓 ⚫️ (❔ ⏪ 🇧🇲), ✋️ 👐 👈 🎓.
👈, 👥 📣 👩🔬 __call__
:
{* ../../docs_src/dependencies/tutorial011.py hl[10] *}
👉 💼, 👉 __call__
⚫️❔ FastAPI 🔜 ⚙️ ✅ 🌖 🔢 & 🎧-🔗, & 👉 ⚫️❔ 🔜 🤙 🚶♀️ 💲 🔢 👆 ➡ 🛠️ 🔢 ⏪.
🔗 👐
& 🔜, 👥 💪 ⚙️ __init__
📣 🔢 👐 👈 👥 💪 ⚙️ "🔗" 🔗:
{* ../../docs_src/dependencies/tutorial011.py hl[7] *}
👉 💼, FastAPI 🏆 🚫 ⏱ 👆 ⚖️ 💅 🔃 __init__
, 👥 🔜 ⚙️ ⚫️ 🔗 👆 📟.
✍ 👐
👥 💪 ✍ 👐 👉 🎓 ⏮️:
{* ../../docs_src/dependencies/tutorial011.py hl[16] *}
& 👈 🌌 👥 💪 "🔗" 👆 🔗, 👈 🔜 ✔️ "bar"
🔘 ⚫️, 🔢 checker.fixed_content
.
⚙️ 👐 🔗
⤴️, 👥 💪 ⚙️ 👉 checker
Depends(checker)
, ↩️ Depends(FixedContentQueryChecker)
, ↩️ 🔗 👐, checker
, 🚫 🎓 ⚫️.
& 🕐❔ ❎ 🔗, FastAPI 🔜 🤙 👉 checker
💖:
checker(q="somequery")
...& 🚶♀️ ⚫️❔ 👈 📨 💲 🔗 👆 ➡ 🛠️ 🔢 🔢 fixed_content_included
:
{* ../../docs_src/dependencies/tutorial011.py hl[20] *}
/// tip
🌐 👉 💪 😑 🎭. & ⚫️ 💪 🚫 📶 🆑 ❔ ⚫️ ⚠.
👫 🖼 😫 🙅, ✋️ 🎦 ❔ ⚫️ 🌐 👷.
📃 🔃 💂♂, 📤 🚙 🔢 👈 🛠️ 👉 🎏 🌌.
🚥 👆 🤔 🌐 👉, 👆 ⏪ 💭 ❔ 👈 🚙 🧰 💂♂ 👷 🔘.
///