- Sort Score
- Result 10 results
- Languages All
Results 11 - 19 of 19 for owner_id (0.16 sec)
-
docs/en/docs/tutorial/sql-databases.md
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) -
docs/zh/docs/tutorial/sql-databases.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Fri Mar 22 01:42:11 GMT 2024 - 27K bytes - Viewed (0) -
docs/en/docs/how-to/sql-databases-peewee.md
It will automatically add an `id` attribute as an integer to be the primary key. It will chose the name of the tables based on the class names. For the `Item`, it will create an attribute `owner_id` with the integer ID of the `User`. But we don't declare it anywhere. ## Create the Pydantic models Now let's check the file `sql_app/schemas.py`. !!! tip
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) -
docs/em/docs/tutorial/sql-databases.md
`item.dict()` & ⤴️ 👥 🚶♀️ `dict`'Ⓜ 🔑-💲 👫 🇨🇻 ❌ 🇸🇲 `Item`, ⏮️: `Item(**item.dict())` & ⤴️ 👥 🚶♀️ ➕ 🇨🇻 ❌ `owner_id` 👈 🚫 🚚 Pydantic *🏷*, ⏮️: `Item(**item.dict(), owner_id=user_id)` ## 👑 **FastAPI** 📱 & 🔜 📁 `sql_app/main.py` ➡️ 🛠️ & ⚙️ 🌐 🎏 🍕 👥 ✍ ⏭. ### ✍ 💽 🏓 📶 🙃 🌌 ✍ 💽 🏓: === "🐍 3️⃣.6️⃣ & 🔛"
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 25.2K bytes - Viewed (1) -
schema/relationship_test.go
FieldSchema: "Toy", Polymorphic: Polymorphic{ID: "owner_id", Type: "Type", Value: "users"}, References: []Reference{ {ForeignKey: "Type", ForeignSchema: "Toy", PrimaryValue: "users"}, }, }, }, }, }) }) t.Run("has many", func(t *testing.T) { type Toy struct { ID int Name string OwnerID int OwnerType string }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 15 03:20:20 GMT 2024 - 25.5K bytes - Viewed (0) -
docs/em/docs/how-to/sql-databases-peewee.md
{!../../../docs_src/sql_databases_peewee/sql_app/models.py!} ``` !!! tip 🏒 ✍ 📚 🎱 🔢. ⚫️ 🔜 🔁 🚮 `id` 🔢 🔢 👑 🔑. ⚫️ 🔜 ⚒ 📛 🏓 ⚓️ 🔛 🎓 📛. `Item`, ⚫️ 🔜 ✍ 🔢 `owner_id` ⏮️ 🔢 🆔 `User`. ✋️ 👥 🚫 📣 ⚫️ 🙆. ## ✍ Pydantic 🏷 🔜 ➡️ ✅ 📁 `sql_app/schemas.py`. !!! tip
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) -
utils/tests/models.go
Number string } type Pet struct { gorm.Model UserID *uint Name string Toy Toy `gorm:"polymorphic:Owner;"` } type Toy struct { gorm.Model Name string OwnerID string OwnerType string } type Tools struct { gorm.Model Name string CustomID string Type string } type Company struct { ID int Name string }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:36:08 GMT 2023 - 2.1K bytes - Viewed (0) -
tests/helper_test.go
} } AssertObjEqual(t, pet, expect, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name") AssertObjEqual(t, pet.Toy, expect.Toy, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "Name", "OwnerID", "OwnerType") if expect.Toy.Name != "" && expect.Toy.OwnerType != "pets" { t.Errorf("toys's OwnerType, expect: %v, got %v", "pets", expect.Toy.OwnerType) } }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 8K bytes - Viewed (0) -
schema/relationship.go
// // type User struct { // Toys []Toy `gorm:"polymorphic:Owner;"` // } // type Pet struct { // Toy Toy `gorm:"polymorphic:Owner;"` // } // type Toy struct { // OwnerID int // OwnerType string // } func (schema *Schema) buildPolymorphicRelation(relation *Relationship, field *Field) { polymorphic := field.TagSettings["POLYMORPHIC"] relation.Polymorphic = &Polymorphic{
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 15 03:20:20 GMT 2024 - 22.4K bytes - Viewed (0)