peewee Documentation
Release 0.9.7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 1.7 Querying API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . entry in my_awesome_blog.entries: ... print entry.title Some entry Another entry Yet another entry 1.7 Querying API 1.7.1 Constructing queries Queries in peewee are constructed one piece at a time. The 0x7f6b0810c610> >>> [u.username for u in user_q] # <-- query is evaluated here [u’admin’, u’staff’, u’editor’] 1.7. Querying API 29 peewee Documentation, Release 0.9.7 We can build up the query by adding some clauses0 码力 | 53 页 | 347.03 KB | 1 年前3
peewee Documentation
Release 1.0.0entry in my_awesome_blog.entries: ... print entry.title Some entry Another entry Yet another entry 1.7 Querying API 1.7.1 Constructing queries Queries in peewee are constructed one piece at a time. The clause at a time. This way, rather complex queries are possible. Here is a barebones select query: 1.7. Querying API 31 peewee Documentation, Release 1.0.0 >>> user_q = User.select() # <-- query is not user_id IN ( SELECT t1.id FROM user AS t1 WHERE t1.is_staff = ? ) ) And here it is using joins: 1.7. Querying API 33 peewee Documentation, Release 1.0.0 # using joins SELECT t1.* FROM blog AS t1 INNER0 码力 | 71 页 | 405.29 KB | 1 年前3
peewee Documentation
Release 3.5.0Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 1.7 Querying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . first in the list. 'my_blog.middleware.PeeweeConnectionMiddleware', # These are the default Django 1.7 middlewares. Yours may differ, # but the important this is that our Peewee middleware comes first. for altering tables, foreign-key constraints cannot be added to a table after it has been created. 1.7 Querying This section will cover the basic CRUD operations commonly performed on a relational database:0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.6.0Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 1.7 Querying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . first in the list. 'my_blog.middleware.PeeweeConnectionMiddleware', # These are the default Django 1.7 middlewares. Yours may differ, # but the important this is that our Peewee middleware comes first. so, please leave a comment on this GitHub issue: https://github.com/coleifer/peewee/issues/1640 1.7 Querying This section will cover the basic CRUD operations commonly performed on a relational database:0 码力 | 302 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 2.10.2your Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.7 Models and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . first in the list. 'my_blog.middleware.PeeweeConnectionMiddleware', # These are the default Django 1.7 middlewares. Yours may differ, # but the important this is that our Peewee middleware comes first. db class Blog(BaseModel): title = CharField() contents = TextField() pub_date = DateTimeField() 1.7 Models and Fields Model classes, Field instances and model instances all map to database concepts:0 码力 | 221 页 | 844.06 KB | 1 年前3
peewee Documentation
Release 3.3.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 1.7 Models and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . first in the list. 'my_blog.middleware.PeeweeConnectionMiddleware', # These are the default Django 1.7 middlewares. Yours may differ, # but the important this is that our Peewee middleware comes first. contents = TextField() pub_date = DateTimeField() 1.6. Database 61 peewee Documentation, Release 3.3.0 1.7 Models and Fields Model classes, Field instances and model instances all map to database concepts:0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.4.0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 1.7 Models and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . first in the list. 'my_blog.middleware.PeeweeConnectionMiddleware', # These are the default Django 1.7 middlewares. Yours may differ, # but the important this is that our Peewee middleware comes first. db class Blog(BaseModel): title = CharField() contents = TextField() pub_date = DateTimeField() 1.7 Models and Fields Model classes, Field instances and model instances all map to database concepts:0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation
Release 2.0.2classmethod table_exists() Return type Boolean whether the table for this model exists in the database 1.7 Fields The Field class is used to describe the mapping of Model attributes to database columns. Each integer ForeignKeyField integer integer integer DateField date date date TimeField time time time 1.7. Fields 31 peewee Documentation, Release 2.0.0 Some fields take special parameters... Field type ’’ Attribute used to map this field to a column type, e.g. “string” or “datetime” 1.7. Fields 33 peewee Documentation, Release 2.0.0 template = ’%(column_type)s’ A template for generating 0 码力 | 65 页 | 315.33 KB | 1 年前3
peewee Documentation Release 2.10.2in the list. 'my_blog.middleware.PeeweeConnectionMiddleware', # These are the default Django 1.7 middlewares. Yours may differ, # but the important this is that our Peewee middleware comes first0 码力 | 275 页 | 276.96 KB | 1 年前3
peewee Documentation Release 3.0.0in the list. 'my_blog.middleware.PeeweeConnectionMiddleware', # These are the default Django 1.7 middlewares. Yours may differ, # but the important this is that our Peewee middleware comes first0 码力 | 319 页 | 361.50 KB | 1 年前3
共 14 条
- 1
- 2













