Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 18 of 18 for instance (0.49 sec)

  1. fastapi/applications.py

                    This is simply inherited from Starlette.
    
                    Read more about it in the
                    [Starlette docs for Applications](https://www.starlette.io/applications/#storing-state-on-the-app-instance).
                    """
                ),
            ] = State()
            self.dependency_overrides: Annotated[
                Dict[Callable[..., Any], Callable[..., Any]],
                Doc(
                    """
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  2. docs_src/path_operation_advanced_configuration/tutorial002.py

        """
        Simplify operation IDs so that generated API clients have simpler function
        names.
    
        Should be called only after all routes have been added.
        """
        for route in app.routes:
            if isinstance(route, APIRoute):
                route.operation_id = route.name  # in this case, 'read_items'
    
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 572 bytes
    - Viewed (0)
  3. fastapi/routing.py

                exclude_none=exclude_none,
            )
        elif isinstance(res, list):
            return [
                _prepare_response_content(
                    item,
                    exclude_unset=exclude_unset,
                    exclude_defaults=exclude_defaults,
                    exclude_none=exclude_none,
                )
                for item in res
            ]
        elif isinstance(res, dict):
            return {
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 170.1K bytes
    - Viewed (0)
  4. scripts/mkdocs_hooks.py

        for item in items:
            if isinstance(item, str):
                resolve_file(item=item, files=files, config=config)
            elif isinstance(item, dict):
                assert len(item) == 1
                values = list(item.values())
                if not values:
                    continue
                if isinstance(values[0], str):
                    resolve_file(item=values[0], files=files, config=config)
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  5. fastapi/datastructures.py

        @classmethod
        def validate(cls: Type["UploadFile"], v: Any) -> Any:
            if not isinstance(v, StarletteUploadFile):
                raise ValueError(f"Expected UploadFile, received: {type(v)}")
            return v
    
        @classmethod
        def _validate(cls, __input_value: Any, _: Any) -> "UploadFile":
            if not isinstance(__input_value, StarletteUploadFile):
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  6. tests/test_inherited_custom_class.py

        from pydantic import field_serializer
    
        app = FastAPI()
    
        @app.get("/fast_uuid")
        def return_fast_uuid():
            asyncpg_uuid = MyUuid("a10ff360-3b1e-4984-a26f-d3ab460bdb51")
            assert isinstance(asyncpg_uuid, uuid.UUID)
            assert type(asyncpg_uuid) != uuid.UUID
            with pytest.raises(TypeError):
                vars(asyncpg_uuid)
            return {"fast_uuid": asyncpg_uuid}
    
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 3K bytes
    - Viewed (0)
  7. fastapi/_compat.py

            use_errors: List[Any] = []
            for error in errors:
                if isinstance(error, ErrorWrapper):
                    new_errors = ValidationError(  # type: ignore[call-arg]
                        errors=[error], model=RequestErrorModel
                    ).errors()
                    use_errors.extend(new_errors)
                elif isinstance(error, list):
                    use_errors.extend(_normalize_errors(error))
                else:
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  8. docs_src/sql_databases_peewee/sql_app/schemas.py

    from pydantic import BaseModel
    from pydantic.utils import GetterDict
    
    
    class PeeweeGetterDict(GetterDict):
        def get(self, key: Any, default: Any = None):
            res = getattr(self._obj, key, default)
            if isinstance(res, peewee.ModelSelect):
                return list(res)
            return res
    
    
    class ItemBase(BaseModel):
        title: str
        description: Union[str, None] = None
    
    
    class ItemCreate(ItemBase):
        pass
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Sat May 14 11:59:59 GMT 2022
    - 868 bytes
    - Viewed (0)
Back to top