Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 61 for get_users (9.43 sec)

  1. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py

    def test_nonexistent_user(client):
        response = client.get("/users/999")
        assert response.status_code == 404, response.text
    
    
    @needs_py310
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_users(client):
        response = client.get("/users/")
        assert response.status_code == 200, response.text
        data = response.json()
        assert "email" in data[0]
        assert "id" in data[0]
    
    
    @needs_py310
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware.py

    @needs_pydanticv1
    def test_nonexistent_user(client):
        response = client.get("/users/999")
        assert response.status_code == 404, response.text
    
    
    # TODO: pv2 add version with Pydantic v2
    @needs_pydanticv1
    def test_get_users(client):
        response = client.get("/users/")
        assert response.status_code == 200, response.text
        data = response.json()
        assert "email" in data[0]
        assert "id" in data[0]
    
    
    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)
  3. docs/en/docs/how-to/sql-databases-peewee.md

    Aso, when returning several objects, like in `get_users`, we directly call `list`, like in:
    
    ```Python
    list(models.User.select())
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Jan 16 13:23:25 GMT 2024
    - 23.6K bytes
    - Viewed (1)
  4. docs/em/docs/how-to/sql-databases-peewee.md

    {!../../../docs_src/sql_databases_peewee/sql_app/crud.py!}
    ```
    
    📤 đŸ”ē ⏎ī¸ 📟 🇸🇲 🔰.
    
    đŸ‘Ĩ đŸšĢ đŸšļ‍♀ī¸ `db` đŸ”ĸ 🤭. ↩ī¸ đŸ‘Ĩ ⚙ī¸ 🏷 🔗. 👉 ↩ī¸ `db` 🎚 🌐 🎚, 👈 🔌 🌐 🔗 ⚛. 👈 âšĢī¸â” đŸ‘Ĩ ✔ī¸ 🌐 `contextvars` ℹ 🔛.
    
    🆖, 🕐❔ đŸ›Ŧ 📚 🎚, 💖 `get_users`, đŸ‘Ĩ 🔗 🤙 `list`, 💖:
    
    ```Python
    list(models.User.select())
    ```
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 19.2K bytes
    - Viewed (0)
  5. tests/scopes_test.go

    	return func(d *gorm.DB) *gorm.DB {
    		return d.Where("name in (?)", names)
    	}
    }
    
    func TestScopes(t *testing.T) {
    	users := []*User{
    		GetUser("ScopeUser1", Config{}),
    		GetUser("ScopeUser2", Config{}),
    		GetUser("ScopeUser3", Config{}),
    	}
    
    	DB.Create(&users)
    
    	var users1, users2, users3 []User
    	DB.Scopes(NameIn1And2).Find(&users1)
    	if len(users1) != 2 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
  6. tests/gorm_test.go

    		}
    
    		var gotUsers []user
    		results = DB.Where("id in (?, ?)", u1.ID, u2.ID).Order("id asc").Select("id, name").Find(&gotUsers)
    		if results.Error != nil {
    			t.Fatalf("errors happened on first: %v", results.Error)
    		} else if results.RowsAffected != 2 {
    			t.Fatalf("rows affected expects: %v, got %v", 2, results.RowsAffected)
    		} else if gotUsers[0].ID != u1.ID {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jun 01 07:22:21 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  7. tests/transaction_test.go

    		t.Fatalf("Should find saved record")
    	}
    }
    
    func TestNestedTransactionWithBlock(t *testing.T) {
    	var (
    		user  = *GetUser("transaction-nested", Config{})
    		user1 = *GetUser("transaction-nested-1", Config{})
    		user2 = *GetUser("transaction-nested-2", Config{})
    	)
    
    	if err := DB.Transaction(func(tx *gorm.DB) error {
    		tx.Create(&user)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  8. tests/update_test.go

    	"time"
    
    	"gorm.io/gorm"
    	"gorm.io/gorm/clause"
    	"gorm.io/gorm/utils"
    	. "gorm.io/gorm/utils/tests"
    )
    
    func TestUpdate(t *testing.T) {
    	var (
    		users = []*User{
    			GetUser("update-1", Config{}),
    			GetUser("update-2", Config{}),
    			GetUser("update-3", Config{}),
    		}
    		user          = users[1]
    		lastUpdatedAt time.Time
    	)
    
    	checkUpdatedAtChanged := func(name string, n time.Time) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  9. tests/create_test.go

    		*GetUser("bulk_4", Config{Account: true, Pets: 3, Toys: 0, Company: false, Manager: true, Team: 0, Languages: 3, Friends: 0}),
    		*GetUser("bulk_5", Config{Account: false, Pets: 0, Toys: 3, Company: true, Manager: false, Team: 1, Languages: 3, Friends: 1}),
    		*GetUser("bulk_6", Config{Account: true, Pets: 4, Toys: 3, Company: false, Manager: true, Team: 1, Languages: 3, Friends: 0}),
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  10. tests/associations_many2many_test.go

    	}
    
    	// Append
    	teams1 := []User{*GetUser("friend-append-1", Config{})}
    	teams2 := []User{}
    	teams3 := []*User{GetUser("friend-append-3-1", Config{}), GetUser("friend-append-3-2", Config{})}
    
    	DB.Model(&users).Association("Team").Append(&teams1, &teams2, &teams3)
    
    	AssertAssociationCount(t, users, "Team", 9, "After Append")
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
Back to top