Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 5 of 5 for hasattr (0.1 seconds)

  1. docs_src/custom_request_and_route/tutorial001_py310.py

    import gzip
    from collections.abc import Callable
    
    from fastapi import Body, FastAPI, Request, Response
    from fastapi.routing import APIRoute
    
    
    class GzipRequest(Request):
        async def body(self) -> bytes:
            if not hasattr(self, "_body"):
                body = await super().body()
                if "gzip" in self.headers.getlist("Content-Encoding"):
                    body = gzip.decompress(body)
                self._body = body
            return self._body
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 976 bytes
    - Click Count (0)
  2. docs_src/custom_request_and_route/tutorial001_an_py310.py

    from typing import Annotated
    
    from fastapi import Body, FastAPI, Request, Response
    from fastapi.routing import APIRoute
    
    
    class GzipRequest(Request):
        async def body(self) -> bytes:
            if not hasattr(self, "_body"):
                body = await super().body()
                if "gzip" in self.headers.getlist("Content-Encoding"):
                    body = gzip.decompress(body)
                self._body = body
            return self._body
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Dec 10 08:55:32 GMT 2025
    - 1015 bytes
    - Click Count (0)
  3. fastapi/_compat/shared.py

            return field_annotation_is_complex(get_args(annotation)[0])
    
        return (
            _annotation_is_complex(annotation)
            or _annotation_is_complex(origin)
            or hasattr(origin, "__pydantic_core_schema__")
            or hasattr(origin, "__get_pydantic_core_schema__")
        )
    
    
    def field_annotation_is_scalar(annotation: Any) -> bool:
        # handle Ellipsis here to make tuple[int, ...] work nicely
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Feb 11 18:32:12 GMT 2026
    - 6.9K bytes
    - Click Count (0)
  4. fastapi/routing.py

                            if item.raw_data is not None:
                                data_str: str | None = item.raw_data
                            elif item.data is not None:
                                if hasattr(item.data, "model_dump_json"):
                                    data_str = item.data.model_dump_json()
                                else:
                                    data_str = json.dumps(jsonable_encoder(item.data))
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Mar 15 11:44:39 GMT 2026
    - 193K bytes
    - Click Count (0)
  5. src/main/webapp/js/search.js

        var goUrl = contextPath + "/go/?rt=" + rt + "&docId=" + docId + "&queryId=" + queryId + "&order=" + order;
    
        var hashIndex = url.indexOf("#");
        if (hashIndex >= 0) {
          var hashStr = url.substring(hashIndex);
          goUrl += "&hash=" + encodeURIComponent(hashStr);
        }
    
        $link.attr("href", goUrl);
      });
    
      $result.on("click", "a.favorite", function(e) {
        e.preventDefault();
        var $favorite = $(this);
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Mon Feb 23 08:03:44 GMT 2026
    - 6.5K bytes
    - Click Count (0)
Back to Top