peewee Documentation Release 3.0.0These query examples are taken from the site PostgreSQL Exercises [https://pgexercises.com/]. A sample data-set can be found on the getting started page [https://pgexercises.com/gettingstarted.html] postgres -f clubdata.sql -d peewee_test -x -q To create the schema using Peewee, without loading the sample data, you can run the following: # Assumes you have created the database "peewee_test" already. that whenever a query is executed on Person to use the contacts database. Note Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation
Release 3.5.0that whenever a query is executed on Person to use the contacts database. Note Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended column. query = (Sample .select( Sample.counter, Sample.value, fn.AVG(Sample.value).over([Sample.counter])) Parameters: .order_by(Sample.counter)) # Equivalent instead. window = Window(partition_by=[Sample.counter]) query = (Sample .select( Sample.counter, Sample.value, fn.AVG(Sample.value).over(window)) .window(window)0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation Release 3.4.0These query examples are taken from the site PostgreSQL Exercises [https://pgexercises.com/]. A sample data-set can be found on the getting started page [https://pgexercises.com/gettingstarted.html] postgres -f clubdata.sql -d peewee_test -x -q To create the schema using Peewee, without loading the sample data, you can run the following: # Assumes you have created the database "peewee_test" already. that whenever a query is executed on Person to use the contacts database. Note Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation Release 3.1.0These query examples are taken from the site PostgreSQL Exercises [https://pgexercises.com/]. A sample data-set can be found on the getting started page [https://pgexercises.com/gettingstarted.html] postgres -f clubdata.sql -d peewee_test -x -q To create the schema using Peewee, without loading the sample data, you can run the following: # Assumes you have created the database "peewee_test" already. that whenever a query is executed on Person to use the contacts database. Note Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation
Release 3.5.0that whenever a query is executed on Person to use the contacts database. Note: Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended query = (Sample .select( Sample.counter, (continues on next page) 1.9. API Documentation 111 peewee Documentation, Release 3.5.0 (continued from previous page) Sample.value, fn.AVG(Sample.value).over([Sample over([Sample.counter])) .order_by(Sample.counter)) # Equivalent example Using a Window() instance instead. window = Window(partition_by=[Sample.counter]) query = (Sample .select( Sample.counter, Sample0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.3.0com/group/peewee-orm 1.5 Query Examples These query examples are taken from the site PostgreSQL Exercises. A sample data-set can be found on the getting started page. Here is a visual representation of the schema postgres -f clubdata.sql -d peewee_test -x -q To create the schema using Peewee, without loading the sample data, you can run the following: # Assumes you have created the database "peewee_test" already. that whenever a query is executed on Person to use the contacts database. Note: Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.4.0com/group/peewee-orm 1.5 Query Examples These query examples are taken from the site PostgreSQL Exercises. A sample data-set can be found on the getting started page. Here is a visual representation of the schema postgres -f clubdata.sql -d peewee_test -x -q To create the schema using Peewee, without loading the sample data, you can run the following: # Assumes you have created the database "peewee_test" already. that whenever a query is executed on Person to use the contacts database. Note: Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation Release 3.6.0that whenever a query is executed on Person to use the contacts database. Note Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended following model and sample data: class Sample(Model): counter = IntegerField() value = FloatField() data = [(1, 10), (1, 20), (2, 1), (2, 3), (3, 100)] Sample.insert_many(data insert_many(data, fields=[Sample.counter, Sample.value]).execute() Our sample table now contains: id counter value 1 1 10.0 2 1 20.0 3 2 1.0 4 2 3.0 5 3 100.0 Ordered Windows Let’s calculate a running sum0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.6.0that whenever a query is executed on Person to use the contacts database. Note: Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended For the following examples, we’ll use the following model and sample data: 1.7. Querying 75 peewee Documentation, Release 3.6.0 class Sample(Model): counter = IntegerField() value = FloatField() data data = [(1, 10), (1, 20), (2, 1), (2, 3), (3, 100)] Sample.insert_many(data, fields=[Sample.counter, Sample.value]).execute() Our sample table now contains: id counter value 1 1 10.0 2 1 20.0 3 2 1.00 码力 | 302 页 | 1.02 MB | 1 年前3
peewee Documentation Release 2.10.2that whenever a query is executed on Person to use the contacts database. Note Take a look at the sample models - you will notice that we created a BaseModel that defined the database, and then extended org/isolation.html] documentation for more information about how SQLite handles concurrent connections. Code sample Creating a database instance does not require any special handling. The SqliteQueueDatabase accepts Blog(Model): content = TextField() search_content = TSVectorField() content = 'this is a sample blog entry.' blog_entry = Blog.create( content=content, search_content=fn.to_tsvector(content))0 码力 | 275 页 | 276.96 KB | 1 年前3
共 16 条
- 1
- 2













