peewee Documentation Release 3.6.0= Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can also use the flags on the Post class to build PrimaryKeyField object at 0x7f51a2e92750> >>> Person._meta.database6dd0> There are several options you can specify as Meta attributes. While most options are inheritable create(counter=1, value=20.) 6> >>> Sample.create(counter=2, value=1.) Our 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 6 1 20.0 7 2 1.0 Let’s examine 0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.6.0database. Uncle Bob decides that too many animals have been dying at Herb’s house, so he adopts Fido: 6 Chapter 1. Contents: peewee Documentation, Release 3.6.0 herb_fido.owner = uncle_bob herb_fido.save() = Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True 48 Chapter 1. Contents: peewee Documentation, Release PrimaryKeyField object at 0x7f51a2e92750> >>> Person._meta.database6dd0> There are several options you can specify as Meta attributes. While most options are inheritable 0 码力 | 302 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.5.0= Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can also use the flags on the Post class to build PrimaryKeyField object at 0x7f51a2e92750> >>> Person._meta.database6dd0> There are several options you can specify as Meta attributes. While most options are inheritable = Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can use the flags on the Post class to build expressions 0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation Release 3.4.0Update the costs to be 6 for members, and 30 for guests. UPDATE facilities SET membercost=6, guestcost=30 WHERE name ILIKE 'Tennis%'; query = (Facility .update(membercost=6, guestcost=30) = Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can also use the flags on the Post class to build PrimaryKeyField object at 0x7f51a2e92750> >>> Person._meta.database6dd0> There are several options you can specify as Meta attributes. While most options are inheritable 0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation
Release 3.5.0database. Uncle Bob decides that too many animals have been dying at Herb’s house, so he adopts Fido: 6 Chapter 1. Contents: peewee Documentation, Release 3.5.0 herb_fido.owner = uncle_bob herb_fido.save() = Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can also use the flags on the Post class to build PrimaryKeyField object at 0x7f51a2e92750> >>> Person._meta.database6dd0> There are several options you can specify as Meta attributes. While most options are inheritable 0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.4.0database. Uncle Bob decides that too many animals have been dying at Herb’s house, so he adopts Fido: 6 Chapter 1. Contents: peewee Documentation, Release 3.4.0 herb_fido.owner = uncle_bob herb_fido.save() Update the costs to be 6 for members, and 30 for guests. UPDATE facilities SET membercost=6, guestcost=30 WHERE name ILIKE 'Tennis%'; query = (Facility .update(membercost=6, guestcost=30) .where(Facility = Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can also use the flags on the Post class to build0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation Release 3.1.0Update the costs to be 6 for members, and 30 for guests. UPDATE facilities SET membercost=6, guestcost=30 WHERE name ILIKE 'Tennis%'; query = (Facility .update(membercost=6, guestcost=30) = Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can also use the flags on the Post class to build PrimaryKeyField object at 0x7f51a2e92750> >>> Person._meta.database6dd0> There are several options you can specify as Meta attributes. While most options are inheritable 0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation
Release 3.3.0database. Uncle Bob decides that too many animals have been dying at Herb’s house, so he adopts Fido: 6 Chapter 1. Contents: peewee Documentation, Release 3.3.0 herb_fido.owner = uncle_bob herb_fido.save() Update the costs to be 6 for members, and 30 for guests. UPDATE facilities SET membercost=6, guestcost=30 WHERE name ILIKE 'Tennis%'; query = (Facility .update(membercost=6, guestcost=30) .where(Facility = Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" 6 >>> p.is_favorite False >>> p.is_sticky True We can also use the flags on the Post class to build0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation Release 3.0.0Update the costs to be 6 for members, and 30 for guests. UPDATE facilities SET membercost=6, guestcost=30 WHERE name ILIKE 'Tennis%'; query = (Facility .update(membercost=6, guestcost=30) PrimaryKeyField object at 0x7f51a2e92750> >>> Person._meta.database6dd0> There are several options you can specify as Meta attributes. While most options are inheritable Post() >>> p.is_sticky = True >>> p.is_minimized = True >>> print(p.flags) # Prints 4 | 2 --> "6" Parameters: 6 >>> p.is_favorite False >>> p.is_sticky True We can use the flags on the Post class to build 0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation
Release 0.9.7Updating and Deleting Creating a new record You can use the Model.create() method on the model: 6 Chapter 1. Contents: peewee Documentation, Release 0.9.7 >>> Blog.create(creator=’Charlie’, name=’My >>> user_q = User.select() # <-- query is not executed >>> user_q6b0810c610> >>> [u.username for u in user_q] # <-- query is evaluated here [u’admin’, u’staff’, u’editor’] executes query and returns a QueryResultWrapper >>> qr 6d0> >>> [u.id for u in qr] [1, 2, 3, 4, 7, 8] >>> [u.id for u in qr] # <-- re-iterating over qr does 0 码力 | 53 页 | 347.03 KB | 1 年前3
共 16 条
- 1
- 2













