peewee Documentation Release 3.0.0Constraints Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Clause Query operators Three valued logic Adding user-defined operators Expressions Foreign Keys Traversing foreign keys Joining tables Implementing Many to Many Self-joins Performance Techniques Avoiding Things get interesting when we set up relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner =0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation
Release 3.5.0Constraints Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Scalar Values Window functions Retrieving row tuples / dictionaries / namedtuples Returning Clause Foreign Keys and Joins Implementing Many to Many Self-joins Performance Techniques Query operators Three Things get interesting when we set up relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner =0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation
Release 3.5.0without having to worry. Things get interesting when we set up relationships between models using foreign keys (wikipedia). This is easy to do with peewee: class Pet(Model): owner = ForeignKeyField(Person store our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating every Person returned by the original SELECT! We can avoid this by performing a JOIN and using a SQL function to aggregate the results. query = (Person .select(Person, fn.COUNT(Pet.id).alias('pet_count'))0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.4.0Constraints Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Clause Query operators Three valued logic Adding user-defined operators Expressions Foreign Keys Traversing foreign keys Joining tables Implementing Many to Many Self-joins Performance Techniques Avoiding Things get interesting when we set up relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner =0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation
Release 3.4.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 1.10 Foreign Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . without having to worry. Things get interesting when we set up relationships between models using foreign keys (wikipedia). This is easy to do with peewee: class Pet(Model): owner = ForeignKeyField(Person store our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation
Release 3.3.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 1.10 Foreign Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . without having to worry. Things get interesting when we set up relationships between models using foreign keys (wikipedia). This is easy to do with peewee: class Pet(Model): owner = ForeignKeyField(Person store our data. This will create the tables with the appropriate columns, indexes, sequences, and foreign key constraints: db.create_tables([Person, Pet]) 1.2.2 Storing data Let’s begin by populating0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.1.0Constraints Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records Clause Query operators Three valued logic Adding user-defined operators Expressions Foreign Keys Traversing foreign keys Joining tables Implementing Many to Many Self-joins Performance Techniques Avoiding Things get interesting when we set up relationships between models using foreign keys (wikipedia) [http://en.wikipedia.org/wiki/Foreign_key]. This is easy to do with peewee: class Pet(Model): owner =0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation Release 1.0.0peewee 1.0.0 documentation » peewee a small orm written in python provides a lightweight querying interface over sql uses sql concepts when querying, like joins and where clauses support for special extensions org/en/latest/peewee/playhouse.html#full-text-search] For flask integration, including an admin interface and RESTful API, check out flask-peewee [https://github.com/coleifer/flask-peewee/]. Contents: Creating tables Model instances Model options Model methods Fields Field types table Self-referential Foreign Keys Implementing Many to Many Non-integer Primary Keys Field class API Querying API Constructing0 码力 | 101 页 | 163.20 KB | 1 年前3
peewee Documentation
Release 2.0.2lightweight querying interface over sql • uses sql concepts when querying, like joins and where clauses • support for some extensions, like hstore For flask integration, including an admin interface and RESTful actually is a wrapper – whatever appears to the right of the dot (i.e. fn.*Lower*) – is treated as a function that can take any arbitrary parameters. If you’re feeling froggy and want to get coding, you might 1)) == ’a’) The “where” clause now contains a tree with one leaf. The leaf represents the nested function expression on the left- hand-side and the scalar value ‘a’ on the right hand side. Peewee will recursively0 码力 | 65 页 | 315.33 KB | 1 年前3
peewee Documentation Release 3.6.0Constraints Non-integer Primary Keys, Composite Keys and other Tricks Self-referential foreign keys Circular foreign key dependencies Querying Creating a new record Bulk inserts Updating existing records functions Retrieving row tuples / dictionaries / namedtuples Returning Clause Common Table Expressions Foreign Keys and Joins Query operators Three valued logic Adding user-defined operators Expressions SQL Performing simple joins Joining multiple tables Selecting from multiple sources Subqueries Multiple foreign-keys to the same Model Joining on arbitrary fields Self-joins Implementing Many to Many Avoiding0 码力 | 377 页 | 399.12 KB | 1 年前3
共 16 条
- 1
- 2













