Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 42 of 42 for get_user (0.14 sec)

  1. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware.py

        assert "id" in data
        response = client.post("/users/", json=test_user)
        assert response.status_code == 400, response.text
    
    
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_user(client):
        response = client.get("/users/1")
        assert response.status_code == 200, response.text
        data = response.json()
        assert "email" in data
        assert "id" in data
    
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.3K bytes
    - Viewed (0)
  2. docs/en/docs/tutorial/sql-databases.md

    And then we can create the required dependency in the *path operation function*, to get that session directly.
    
    With that, we can just call `crud.get_user` directly from inside of the *path operation function* and use that session.
    
    !!! tip
        Notice that the values you return are SQLAlchemy models, or lists of SQLAlchemy models.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 29.6K bytes
    - Viewed (0)
Back to top