peewee Documentation Release 3.5.0
operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 1.9 API Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . character appropriate to your database. You can also find this parameter by checking Database.param. 1.9 API Documentation This document specifies Peewee’s APIs. 1.9.1 Database class Database(database[ is closed upon completion. with database.connection_context(): database.create_tables(APP_MODELS) 1.9. API Documentation 91 peewee Documentation, Release 3.5.0 connect([reuse_if_open=False]) Parameters0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 1.0.0
class PostgresqlAdapter(BaseAdapter) Subclass of BaseAdapter that works with the “psycopg2” driver 1.9 Playhouse, a collection of addons Peewee comes with numerous extras which I didn’t really feel like you wish to use _extension_module The name of the extension module to use with this virtual table 1.9. Playhouse, a collection of addons 55 peewee Documentation, Release 1.0.0 1.9.2 Postgresql Extensions where(hexist(’features’, [’garage’])): ... print h.address, h.features[’garage’] # <-- just houses w/garage data 1.9. Playhouse, a collection of addons 57 peewee Documentation, Release 1.0.0 123 Main St 2 cars ltree0 码力 | 71 页 | 405.29 KB | 1 年前3peewee Documentation Release 3.6.0
operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 1.9 Relationships and Joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . this parameter by checking Database.param. 1.9 Relationships and Joins In this document we’ll cover how Peewee handles relationships between models. 1.9. Relationships and Joins 91 peewee Documentation query = (Tweet .select() .join(User, on=(Tweet.user == User.id)) .where(User.username == 'huey')) 1.9. Relationships and Joins 93 peewee Documentation, Release 3.6.0 If we already had a reference to0 码力 | 302 页 | 1.02 MB | 1 年前3peewee Documentation Release 2.0.2
the given model. Performs the query 48 Chapter 1. Contents: peewee Documentation, Release 2.0.0 1.9 Databases Below the Model level, peewee uses an abstraction for representing the database. The Database FooDatabase(Database): def _connect(self, database, **kwargs): return foodb.connect(database, **kwargs) 1.9. Databases 49 peewee Documentation, Release 2.0.0 Essential methods to override The Database provides Note: If you initialized with threadlocals=True, then this will store the connection inside a thread- 1.9. Databases 51 peewee Documentation, Release 2.0.0 local, ensuring that connections are not shared0 码力 | 65 页 | 315.33 KB | 1 年前3peewee Documentation Release 2.10.2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 1.9 Query operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . information, see: • UpdateQuery.returning() • InsertQuery.returning() • DeleteQuery.returning() 1.9 Query operators The following types of comparisons are supported by peewee: Comparison Meaning == select().where(User.is_admin == True) non_admin_tweets = Tweet.select().where( ~(Tweet.user << admins)) 1.9. Query operators 65 peewee Documentation, Release 2.10.2 # Find any users who are not my friends0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 3.3.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 1.9 Query operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FROM clause. To select all columns from a particular table, you can simply pass in the Model class. 1.9 Query operators The following types of comparisons are supported by peewee: Comparison Meaning == not_in() instead of in and not in • Use & instead of and • Use | instead of or • Use ~ instead of not 1.9. Query operators 95 peewee Documentation, Release 3.3.0 • Use .is_null() instead of is None or ==0 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 1.9 Query operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FROM clause. To select all columns from a particular table, you can simply pass in the Model class. 1.9 Query operators The following types of comparisons are supported by peewee: Comparison Meaning == ran out of operators to override, there are some additional query operations available as methods: 1.9. Query operators 95 peewee Documentation, Release 3.4.0 Method Meaning .contains(substr) Wild-card0 码力 | 284 页 | 1.03 MB | 1 年前3
共 7 条
- 1