Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 10 for file_content (0.06 seconds)

  1. tests/test_file_and_form_order_issue_9116.py

    
    @app.post("/file_before_form")
    def file_before_form(
        file: bytes = File(),
        city: str = Form(),
    ):
        return {"file_content": file, "city": city}
    
    
    @app.post("/file_after_form")
    def file_after_form(
        city: str = Form(),
        file: bytes = File(),
    ):
        return {"file_content": file, "city": city}
    
    
    @app.post("/file_list_before_form")
    def file_list_before_form(
        files: Annotated[list[bytes], File()],
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 21:25:59 GMT 2025
    - 2.3K bytes
    - Click Count (0)
  2. build-logic/integration-testing/src/main/kotlin/gradlebuild/integrationtests/tasks/GenerateAutoTestedSamplesTestTask.kt

    import org.junit.Test
    
    class ${className} extends AbstractAutoTestedSamplesTest {
        private static final String FILE_CONTENT = '''
            ${fileContent}
        '''
        @Test
        void runSamples() {
            runSamplesFromFile(new File('${file.relativePath.toString().replace("\\", "/")}'), FILE_CONTENT)
        }
    }
    """
            )
        }
    Created: Wed Dec 31 11:36:14 GMT 2025
    - Last Modified: Fri Dec 19 06:44:41 GMT 2025
    - 3.9K bytes
    - Click Count (0)
  3. docs_src/dependencies/tutorial011_an_py39.py

    from typing import Annotated
    
    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    class FixedContentQueryChecker:
        def __init__(self, fixed_content: str):
            self.fixed_content = fixed_content
    
        def __call__(self, q: str = ""):
            if q:
                return self.fixed_content in q
            return False
    
    
    checker = FixedContentQueryChecker("bar")
    
    
    @app.get("/query-checker/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Sat Mar 18 12:29:59 GMT 2023
    - 544 bytes
    - Click Count (0)
  4. tests/test_tutorial/test_custom_response/test_tutorial007.py

    from fastapi.testclient import TestClient
    
    from docs_src.custom_response.tutorial007_py39 import app
    
    client = TestClient(app)
    
    
    def test_get():
        fake_content = b"some fake video bytes"
        response = client.get("/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 269 bytes
    - Click Count (0)
  5. docs_src/dependencies/tutorial011_py39.py

    from fastapi import Depends, FastAPI
    
    app = FastAPI()
    
    
    class FixedContentQueryChecker:
        def __init__(self, fixed_content: str):
            self.fixed_content = fixed_content
    
        def __call__(self, q: str = ""):
            if q:
                return self.fixed_content in q
            return False
    
    
    checker = FixedContentQueryChecker("bar")
    
    
    @app.get("/query-checker/")
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Wed Dec 17 20:41:43 GMT 2025
    - 504 bytes
    - Click Count (0)
  6. build-logic-commons/module-identity/src/main/kotlin/gradlebuild.module-identity.gradle.kts

    /**
     * Returns the trimmed contents of the file at the given [path] after
     * marking the file as a build logic input.
     */
    fun Project.trimmedContentsOfFile(path: String): Provider<String> =
        providers.fileContents(repoRoot().file(path)).asText.map { it.trim() }
    
    // TODO Simplify the buildTimestamp() calculation if possible
    fun Project.buildTimestamp(): Provider<String> =
        providers.of(BuildTimestampValueSource::class) {
    Created: Wed Dec 31 11:36:14 GMT 2025
    - Last Modified: Thu Oct 30 16:56:31 GMT 2025
    - 5.9K bytes
    - Click Count (0)
  7. docs/zh/docs/advanced/advanced-dependencies.md

    本例中,**FastAPI** 不使用 `__init__`,我们要直接在代码中使用。
    
    ## 创建实例
    
    使用以下代码创建类实例:
    
    {* ../../docs_src/dependencies/tutorial011.py hl[16] *}
    
    这样就可以**参数化**依赖项,它包含 `checker.fixed_content` 的属性 - `"bar"`。
    
    ## 把实例作为依赖项
    
    然后,不要再在 `Depends(checker)` 中使用 `Depends(FixedContentQueryChecker)`, 而是要使用 `checker`,因为依赖项是类实例 - `checker`,不是类。
    
    处理依赖项时,**FastAPI** 以如下方式调用 `checker`:
    
    ```Python
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 1.9K bytes
    - Click Count (0)
  8. build-logic/documentation/src/main/groovy/gradlebuild/docs/GradleReleaseNotesPlugin.java

                task.getReleaseNotes().set(extension.getReleaseNotes().getMarkdownFile());
                task.getMilestone().convention(project.getProviders().fileContents(project.getIsolated().getRootProject().getProjectDirectory().file("version.txt")).getAsText().map(String::trim));
            });
    
            Configuration jquery = project.getConfigurations().create("jquery", conf -> {
    Created: Wed Dec 31 11:36:14 GMT 2025
    - Last Modified: Fri May 16 18:26:52 GMT 2025
    - 6.2K bytes
    - Click Count (0)
  9. docs/ko/docs/advanced/advanced-dependencies.md

    이 경우, **FastAPI**는 `__init__`에 전혀 관여하지 않으며, 우리는 이 메서드를 코드에서 직접 사용하게 됩니다.
    
    ## 인스턴스 생성하기
    
    다음과 같이 이 클래스의 인스턴스를 생성할 수 있습니다:
    
    {* ../../docs_src/dependencies/tutorial011_an_py39.py hl[18] *}
    
    이렇게 하면 `checker.fixed_content` 속성에 `"bar"`라는 값을 담아 의존성을 "매개변수화"할 수 있습니다.
    
    ## 인스턴스를 의존성으로 사용하기
    
    그런 다음, `Depends(FixedContentQueryChecker)` 대신 `Depends(checker)`에서 이 `checker` 인스턴스를 사용할 수 있으며,
    클래스 자체가 아닌 인스턴스 `checker`가 의존성이 됩니다.
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Mon Nov 18 02:25:44 GMT 2024
    - 2.9K bytes
    - Click Count (0)
  10. docs/en/docs/advanced/advanced-dependencies.md

    {* ../../docs_src/dependencies/tutorial011_an_py39.py hl[18] *}
    
    And that way we are able to "parameterize" our dependency, that now has `"bar"` inside of it, as the attribute `checker.fixed_content`.
    
    ## Use the instance as a dependency { #use-the-instance-as-a-dependency }
    
    Created: Sun Dec 28 07:19:09 GMT 2025
    - Last Modified: Thu Nov 13 07:37:15 GMT 2025
    - 9.1K bytes
    - Click Count (0)
Back to Top