Performance Techniques Avoiding N+1 queries List recent tweets List users and all their tweets Using prefetch Iterating over lots of rows Speeding up Bulk Inserts Perform...
Querying Creating a new record Bulk inserts Updating existing records Atomic updates Deleting records Selecting a single record Create or get Selecting multiple records Fil...
Model definitions Creating test data Model definitions We’ll use the following model definitions for our examples: import datetime from peewee import * db = S...
Querying Creating a new record Bulk inserts Updating existing records Atomic updates Deleting records Selecting a single record Create or get Selecting multiple records Fil...
Model options and table metadata Meta.primary_key Model options and table metadata In order not to pollute the model namespace, model-specific configuration is placed in a spe...
Contributing Contributing In order to continually improve, Peewee needs the help of developers like you.Whether it’s contributing patches, submitting bug reports, or just askin...
Performing simple joins Performing simple joins As an exercise in learning how to perform joins with Peewee, let’s write a query to print out all the tweets by “huey”. To do th...
Database Errors Database Errors The Python DB-API 2.0 spec describes several types of exceptions . Because most database drivers have their own implementations of these excepti...
Logging queries Logging queries All queries are logged to the peewee namespace using the standard librarylogging module. Queries are logged using the DEBUG level. If you’reint...
Models and Fields Models and Fields Model classes, Field instances and model instances all map to database concepts: Thing Corresponds to… Model class Database table Fie...