Search Options

Results per page
Sort
Preferred Languages
Advance

Results 421 - 430 of 1,074 for Str (0.02 sec)

  1. tests/test_extra_routes.py

    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        price: Optional[float] = None
    
    
    @app.api_route("/items/{item_id}", methods=["GET"])
    def get_items(item_id: str):
        return {"item_id": item_id}
    
    
    def get_not_decorated(item_id: str):
        return {"item_id": item_id}
    
    
    app.add_api_route("/items-not-decorated/{item_id}", get_not_decorated)
    
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Fri Jul 07 17:12:13 UTC 2023
    - 13.7K bytes
    - Viewed (0)
  2. docs_src/bigger_applications/app/routers/items.py

    @router.get("/{item_id}")
    async def read_item(item_id: str):
        if item_id not in fake_items_db:
            raise HTTPException(status_code=404, detail="Item not found")
        return {"name": fake_items_db[item_id]["name"], "item_id": item_id}
    
    
    @router.put(
        "/{item_id}",
        tags=["custom"],
        responses={403: {"description": "Operation forbidden"}},
    )
    async def update_item(item_id: str):
        if item_id != "plumbus":
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Nov 29 17:32:18 UTC 2020
    - 1011 bytes
    - Viewed (0)
  3. docs_src/sql_databases/tutorial002.py

    
    class HeroBase(SQLModel):
        name: str = Field(index=True)
        age: Union[int, None] = Field(default=None, index=True)
    
    
    class Hero(HeroBase, table=True):
        id: Union[int, None] = Field(default=None, primary_key=True)
        secret_name: str
    
    
    class HeroPublic(HeroBase):
        id: int
    
    
    class HeroCreate(HeroBase):
        secret_name: str
    
    
    class HeroUpdate(HeroBase):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  4. docs_src/sql_databases/tutorial002_an_py310.py

    
    class HeroBase(SQLModel):
        name: str = Field(index=True)
        age: int | None = Field(default=None, index=True)
    
    
    class Hero(HeroBase, table=True):
        id: int | None = Field(default=None, primary_key=True)
        secret_name: str
    
    
    class HeroPublic(HeroBase):
        id: int
    
    
    class HeroCreate(HeroBase):
        secret_name: str
    
    
    class HeroUpdate(HeroBase):
        name: str | None = None
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Wed Oct 09 19:44:42 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  5. docs/em/docs/tutorial/security/get-current-user.md

    # 🤚 ⏮️ 👩‍💻
    
    ⏮️ 📃 💂‍♂ ⚙️ (❔ 🧢 🔛 🔗 💉 ⚙️) 🤝 *➡ 🛠️ 🔢* `token` `str`:
    
    ```Python hl_lines="10"
    {!../../docs_src/security/tutorial001.py!}
    ```
    
    ✋️ 👈 🚫 👈 ⚠.
    
    ➡️ ⚒ ⚫️ 🤝 👥 ⏮️ 👩‍💻.
    
    ## ✍ 👩‍💻 🏷
    
    🥇, ➡️ ✍ Pydantic 👩‍💻 🏷.
    
    🎏 🌌 👥 ⚙️ Pydantic 📣 💪, 👥 💪 ⚙️ ⚫️ 🙆 🙆:
    
    //// tab | 🐍 3️⃣.6️⃣ & 🔛
    
    ```Python hl_lines="5  12-16"
    {!> ../../docs_src/security/tutorial002.py!}
    ```
    
    ////
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  6. compat/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/UserPropertiesArtifactRelocationSource.java

        }
    
        private static boolean isAny(String str) {
            return "*".equals(str);
        }
    
        private static boolean matches(String pattern, String str) {
            if (isAny(pattern)) {
                return true;
            } else if (pattern.endsWith("*")) {
                return str.startsWith(pattern.substring(0, pattern.length() - 1));
            } else {
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 9.1K bytes
    - Viewed (0)
  7. docs/fr/docs/tutorial/query-params.md

    ///
    
    /// note
    
    **FastAPI** saura que `q` est optionnel grâce au `=None`.
    
    Le `Optional` dans `Optional[str]` n'est pas utilisé par **FastAPI** (**FastAPI** n'en utilisera que la partie `str`), mais il servira tout de même à votre éditeur de texte pour détecter des erreurs dans votre code.
    
    ///
    
    ## Conversion des types des paramètres de requête
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 17:06:01 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  8. docs_src/schema_extra_example/tutorial005.py

    from typing import Union
    
    from fastapi import Body, FastAPI
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    class Item(BaseModel):
        name: str
        description: Union[str, None] = None
        price: float
        tax: Union[float, None] = None
    
    
    @app.put("/items/{item_id}")
    async def update_item(
        *,
        item_id: int,
        item: Item = Body(
            openapi_examples={
                "normal": {
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sat Aug 26 18:03:13 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  9. tests/test_invalid_path_param.py

            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/{id}")
            def read_items(id: List[Item]):
                pass  # pragma: no cover
    
    
    def test_invalid_tuple():
        with pytest.raises(AssertionError):
            app = FastAPI()
    
            class Item(BaseModel):
                title: str
    
            @app.get("/items/{id}")
            def read_items(id: Tuple[Item, Item]):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Mon Jun 03 17:59:40 UTC 2019
    - 1.7K bytes
    - Viewed (0)
  10. guava-tests/test/com/google/common/eventbus/outside/OutsideEventBusTest.java

        final AtomicInteger deliveries = new AtomicInteger();
        EventBus bus = new EventBus();
        bus.register(
            new Object() {
              @Subscribe
              public void accept(String str) {
                holder.set(str);
                deliveries.incrementAndGet();
              }
            });
    
        String EVENT = "Hello!";
        bus.post(EVENT);
    
        assertEquals("Only one event should be delivered.", 1, deliveries.get());
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 1.8K bytes
    - Viewed (0)
Back to top