Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 80 for and (0.17 sec)

  1. fastapi/encoders.py

                This is mainly a hack for compatibility with SQLAlchemy objects, they
                store internal SQLAlchemy-specific state in attributes named with `_sa`,
                and those objects can't (and shouldn't be) serialized to JSON.
                """
            ),
        ] = True,
    ) -> Any:
        """
        Convert any object to something that can be encoded in JSON.
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  2. fastapi/_compat.py

            if not (
                field.shape == SHAPE_SINGLETON  # type: ignore[attr-defined]
                and not lenient_issubclass(field.type_, BaseModel)
                and not lenient_issubclass(field.type_, dict)
                and not field_annotation_is_sequence(field.type_)
                and not is_dataclass(field.type_)
                and not isinstance(field_info, params.Body)
            ):
                return False
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  3. ci/official/wheel_test/test_import_api_packages.py

    # distributed under the License is distributed on an "AS IS" BASIS,
    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    # ==============================================================================
    
    """Import API packages test.
    
    This is a Python test that verifies whether API v2 packages can be imported
    Python
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Wed Sep 13 15:52:07 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  4. fastapi/datastructures.py

        If you are using a regular `def` function, you can use the `upload_file.file`
        attribute to access the raw standard Python file (blocking, not async), useful and
        needed for non-async code.
    
        Read more about it in the
        [FastAPI docs for Request Files](https://fastapi.tiangolo.com/tutorial/request-files/).
    
        ## Example
    
        ```python
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  5. scripts/mkdocs_hooks.py

        dir_path = Path(config.docs_dir)
        lang = dir_path.parent.name
        if lang in available_langs:
            config.theme["language"] = lang
        if not (config.site_url or "").endswith(f"{lang}/") and not lang == "en":
            config.site_url = f"{config.site_url}{lang}/"
        return config
    
    
    def resolve_file(*, item: str, files: Files, config: MkDocsConfig) -> None:
        item_path = Path(config.docs_dir) / item
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Oct 24 20:26:06 GMT 2023
    - 5.1K bytes
    - Viewed (0)
  6. tests/test_empty_router.py

            response = client.get("/prefix/")
            assert response.status_code == 200, response.text
            assert response.json() == ["OK"]
    
    
    def test_include_empty():
        # if both include and router.path are empty - it should raise exception
        with pytest.raises(FastAPIError):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Jun 11 22:37:34 GMT 2023
    - 805 bytes
    - Viewed (0)
  7. docs/sts/client_grants/sts_element.py

        """STS aware XML parsing class. Wraps a root element name and
        cElementTree.Element instance. Provides STS namespace aware parsing
        functions.
    
        """
    
        def __init__(self, root_name, element):
            self.root_name = root_name
            self.element = element
    
        @classmethod
        def fromstring(cls, root_name, data):
            """Initialize STSElement from name and XML string data.
    
    Python
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 2.5K bytes
    - Viewed (0)
  8. fastapi/security/open_id_connect_url.py

                Doc(
                    """
                    By default, if no HTTP Authorization header is provided, required for
                    OpenID Connect authentication, it will automatically cancel the request
                    and send the client an error.
    
                    If `auto_error` is set to `False`, when the HTTP Authorization header
                    is not available, instead of erroring out, the dependency result will
                    be `None`.
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 2.7K bytes
    - Viewed (0)
  9. tests/test_dependency_normal_exceptions.py

    
    @app.put("/user/{user_id}")
    def put_user(user_id: str, name: str = Body(), db: dict = Depends(get_database)):
        db[user_id] = name
        return {"message": "OK"}
    
    
    @pytest.fixture(autouse=True)
    def reset_state_and_db():
        global fake_database
        global state
        fake_database = initial_fake_database.copy()
        state = initial_state.copy()
    
    
    client = TestClient(app)
    
    
    def test_dependency_gets_exception():
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sat Feb 24 23:06:37 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  10. docs_src/websockets/tutorial002.py

    
    async def get_cookie_or_token(
        websocket: WebSocket,
        session: Union[str, None] = Cookie(default=None),
        token: Union[str, None] = Query(default=None),
    ):
        if session is None and token is None:
            raise WebSocketException(code=status.WS_1008_POLICY_VIOLATION)
        return session or token
    
    
    @app.websocket("/items/{item_id}/ws")
    async def websocket_endpoint(
        websocket: WebSocket,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Sun Nov 13 16:10:54 GMT 2022
    - 2.8K bytes
    - Viewed (0)
Back to top