peewee Documentation Release 2.0.2
never thought of 1.3.2 Changes from version 1.0 The biggest changes between 1.0 and 2.0 are in the syntax used for constructing queries. The first iteration of peewee I threw up on github was about 600 lines and experience, I decided to rewrite and unify the API a bit. The result is a tradeoff. The newer syntax may be a bit more verbose at times, but at least it will be consistent. 4 Chapter 1. Contents: ’a’) ) Note: If you are already familiar with Django’s ORM, you can use the “double underscore” syntax using the SelectQuery.filter() method: >>> for tweet in Tweet.filter(user__username=’Charlie’):0 码力 | 65 页 | 315.33 KB | 1 年前3peewee Documentation Release 0.9.7
atomic update TweetCount.update(count=F('count') + 1).where(user=charlie) You can use django-style syntax to create select queries: # how many active users are there? User.filter(active=True).count() # Another Entry If you are already familiar with Django’s ORM, you can use the “double underscore” syntax: >>> for entry in Entry.filter(blog__name='My Blog'): ... print entry.title Old entry Some Entry a django-like syntax for building a query. The key difference between filter() and SelectQuery.where() is that filter() supports traversing joins using django’s “double-underscore” syntax: >>> sq = Entry0 码力 | 78 页 | 143.68 KB | 1 年前3peewee Documentation Release 0.9.7
atomic update TweetCount.update(count=F(’count’) + 1).where(user=charlie) You can use django-style syntax to create select queries: # how many active users are there? User.filter(active=True).count() # Another Entry If you are already familiar with Django’s ORM, you can use the “double underscore” syntax: >>> for entry in Entry.filter(blog__name=’My Blog’): ... print entry.title Old entry Some Entry django-like syntax for building a query. The key difference between filter() and SelectQuery.where() is that filter() supports traversing joins using django’s “double- underscore” syntax: >>> sq = Entry0 码力 | 53 页 | 347.03 KB | 1 年前3peewee Documentation Release 1.0.0
atomic update TweetCount.update(count=F('count') + 1).where(user=charlie) You can use django-style syntax to create select queries: # how many active users are there? User.filter(active=True).count() # Another Entry If you are already familiar with Django’s ORM, you can use the “double underscore” syntax: >>> for entry in Entry.filter(blog__name='My Blog'): ... print entry.title Old entry Some Entry a django-like syntax for building a query. The key difference between filter() and SelectQuery.where() is that filter() supports traversing joins using django’s “double-underscore” syntax: >>> sq = Entry0 码力 | 101 页 | 163.20 KB | 1 年前3peewee Documentation Release 1.0.0
atomic update TweetCount.update(count=F(’count’) + 1).where(user=charlie) You can use django-style syntax to create select queries: # how many active users are there? User.filter(active=True).count() # Another Entry If you are already familiar with Django’s ORM, you can use the “double underscore” syntax: 1.3. Peewee Cookbook 9 peewee Documentation, Release 1.0.0 >>> for entry in Entry.filter(blog__name=’My django-like syntax for building a query. The key difference between filter() and SelectQuery.where() is that filter() supports traversing joins using django’s “double- underscore” syntax: >>> sq = Entry0 码力 | 71 页 | 405.29 KB | 1 年前3peewee Documentation Release 2.10.2
explicit in your code when you want to sort your results. That said, to specify a default ordering, the syntax is similar to that of Django. Meta.order_by is a tuple of field names, and to indicate descending issue a REPLACE query. Currently this feature is not supported for Postgres databases, but the 9.5 syntax will be added soon. Note This feature is only available on SQLite and MySQL databases. on_conflict([action=None])0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.10.2
explicit in your code when you want to sort your results. That said, to specify a default ordering, the syntax is similar to that of Django. Meta.order_by is a tuple of field names, and to indicate descending issue a REPLACE query. Currently this feature is not supported for Postgres databases, but the 9.5 syntax will be added soon. Note: This feature is only available on SQLite and MySQL databases. on_con0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 3.5.0
any potential constraint violation. Postgresql and SQLite (3.24.0 and newer) provide a different syntax that allows for more granular control over which constraint violation should trigger the conflict0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.4.0
any potential constraint violation. Postgresql and SQLite (3.24.0 and newer) provide a different syntax that allows for more granular control over which constraint violation should trigger the conflict0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.5.0
any potential constraint violation. Postgresql and SQLite (3.24.0 and newer) provide a different syntax that allows for more granular control over which constraint violation should trigger the conflict0 码力 | 282 页 | 1.02 MB | 1 年前3
共 13 条
- 1
- 2