peewee Documentation
Release 3.6.0Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand database: for person in Person.select(): print(person.name) # prints: # Bob # Grandma L. # Herb Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type == 'cat') is a big problem with the previous query: because we are accessing pet.owner.name and we did not select this relation in our original query, peewee will have to perform an additional query to retrieve0 码力 | 302 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.6.0Exercises Joins and Subqueries Modifying Data Aggregation Recursion Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand database: for person in Person.select(): print(person.name) # prints: # Bob # Grandma L. # Herb Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type == 'cat')0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.5.0Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand person in Person.select(): print(person.name, person.is_relative) # prints: # Bob True # Grandma L. True # Herb False Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type is a big problem with the previous query: because we are accessing pet.owner.name and we did not select this relation in our original query, peewee will have to perform an additional query to retrieve0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.5.0Exercises Joins and Subqueries Modifying Data Aggregation Recursion Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand person in Person.select(): print(person.name, person.is_relative) # prints: # Bob True # Grandma L. True # Herb False Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation
Release 3.4.0Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand person in Person.select(): print(person.name, person.is_relative) # prints: # Bob True # Grandma L. True # Herb False Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type is a big problem with the previous query: because we are accessing pet.owner.name and we did not select this relation in our original query, peewee will have to perform an additional query to retrieve0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation Release 3.4.0Migrations Reflection Database URL Connection pool Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand person in Person.select(): print(person.name, person.is_relative) # prints: # Bob True # Grandma L. True # Herb False Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation
Release 3.3.0Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand person in Person.select(): print(person.name, person.is_relative) # prints: # Bob True # Grandma L. True # Herb False Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type is a big problem with the previous query: because we are accessing pet.owner.name and we did not select this relation in our original query, peewee will have to perform an additional query to retrieve0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.1.0Reflection Database URL Connection pool Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Grandma’s record from the database. To get a single record from the database, use Select.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand person in Person.select(): print(person.name, person.is_relative) # prints: # Bob True # Grandma L. True # Herb False Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation Release 3.0.0Migrations Reflection Database URL Connection pool Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries Update queries Delete queries More Hacks Optimistic Locking Top object per the database. To get a single record from the database, use SelectQuery.get(): grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand Model.get(): person in Person.select(): print person.name, person.is_relative # prints: # Bob True # Grandma L. True # Herb False Let’s list all the cats and their owner’s name: query = Pet.select().where(Pet.animal_type0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation
Release 2.10.2database. To get a single record from the database, use SelectQuery. get(): >>> grandma = Person.select().where(Person.name == 'Grandma L.').get() We can also use the equivalent shorthand Model.get(): person in Person.select(): ... print person.name, person.is_relative ... Bob True Grandma L. True Herb False Let’s list all the cats and their owner’s name: >>> query = Pet.select().where(Pet.animal_type is a big problem with the previous query: because we are accessing pet.owner.name and we did not select this value in our original query, peewee will have to perform an additional query to retrieve the0 码力 | 221 页 | 844.06 KB | 1 年前3
共 477 条
- 1
- 2
- 3
- 4
- 5
- 6
- 48













