peewee Documentation Release 0.9.7
another way of expressing the same User.select({ User: ['*'], Tweet: [Count('id', 'count')] }).group_by('id').join(Tweet).order_by(('count', 'desc')) # do an atomic update TweetCount.update(count=F('count') SELECT "id", "creator", "name" FROM "blog" WHERE "id" = ? LIMIT 1 PARAMS: [1] To delete an arbitrary group of records, you can issue a DELETE query. The following will delete all Entry objects that are a year equivalent to the following: query = Blog.select({ Blog: ['*'], Entry: [Count('id')], }).group_by(Blog).join(Entry) The resulting query will return Blog objects with all their normal attributes0 码力 | 78 页 | 143.68 KB | 1 年前3peewee Documentation Release 0.9.7
# another way of expressing the same User.select({ User: [’*’], Tweet: [Count(’id’, ’count’)] }).group_by(’id’).join(Tweet).order_by((’count’, ’desc’)) # do an atomic update TweetCount.update(count=F(’count’) SELECT "id", "creator", "name" FROM "blog" WHERE "id" = ? LIMIT 1 PARAMS: [1] To delete an arbitrary group of records, you can issue a DELETE query. The following will delete all Entry objects that are a year This is equivalent to the following: query = Blog.select({ Blog: [’*’], Entry: [Count(’id’)], }).group_by(Blog).join(Entry) The resulting query will return Blog objects with all their normal attributes0 码力 | 53 页 | 347.03 KB | 1 年前3peewee Documentation Release 1.0.0
another way of expressing the same User.select({ User: ['*'], Tweet: [Count('id', 'count')] }).group_by('id').join(Tweet).order_by(('count', 'desc')) # do an atomic update TweetCount.update(count=F('count') "id", "creator", "name" FROM "blog" WHERE "id" = ? LIMIT 1 PARAMS: [1] To delete an arbitrary group of records, you can issue a DELETE query. The following will delete all Entry objects that are a year equivalent to the following: query = Blog.select({ Blog: ['*'], Entry: [Count('id')], }).group_by(Blog).join(Entry) The resulting query will return Blog objects with all their normal attributes0 码力 | 101 页 | 163.20 KB | 1 年前3peewee Documentation Release 1.0.0
# another way of expressing the same User.select({ User: [’*’], Tweet: [Count(’id’, ’count’)] }).group_by(’id’).join(Tweet).order_by((’count’, ’desc’)) # do an atomic update TweetCount.update(count=F(’count’) SELECT "id", "creator", "name" FROM "blog" WHERE "id" = ? LIMIT 1 PARAMS: [1] To delete an arbitrary group of records, you can issue a DELETE query. The following will delete all Entry objects that are a year This is equivalent to the following: query = Blog.select({ Blog: [’*’], Entry: [Count(’id’)], }).group_by(Blog).join(Entry) The resulting query will return Blog objects with all their normal attributes0 码力 | 71 页 | 405.29 KB | 1 年前3peewee Documentation Release 2.0.2
similar way of expressing the same User.select( User, fn.Count(Tweet.id).alias(’ct’) ).join(Tweet).group_by(User).order_by(R(’ct desc’)) # do an atomic update Counter.update(count=Counter.count + 1).where( ’last_date’)] }).join(Tweet, ’LEFT OUTER’).group_by(User) # 2.0 User.select( User, fn.Max(Tweet.created_date).alias(’last_date’) ).join(Tweet, JOIN_LEFT_OUTER).group_by(User) Let’s do an atomic update on SELECT t1."id", t1."username" FROM "user" AS t1 WHERE t1."id" = ? PARAMS: [1] To delete an arbitrary group of records, you can issue a DELETE query. The following will delete all Tweet objects that are a year0 码力 | 65 页 | 315.33 KB | 1 年前3peewee Documentation Release 2.10.2
Savepoint and ExecutionContext Metadata Types Misc Hacks Optimistic Locking Top object per group Top N objects per group Writing custom functions with SQLite Note If you find any bugs, odd behavior, or have your queries as complex as you like. All the other SQL clauses are available as well, such as: group_by() having() limit() and offset() Check the documentation on Querying for more info. Working with questions, but it may take a bit to get to them. Ask on the mailing list, https://groups.google.com/group/peewee-orm Managing your Database This document describes how to perform typical database-related0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.10.2
your queries as complex as you like. All the other SQL clauses are available as well, such as: • group_by() 1.2. Quickstart 9 peewee Documentation, Release 2.10.2 • having() • limit() and offset() questions, but it may take a bit to get to them. • Ask on the mailing list, https://groups.google.com/group/peewee-orm 1.6 Managing your Database This document describes how to perform typical database-related (User .select(User.username, fn.COUNT(Tweet.id).alias('num_tweets')) .join(Tweet, JOIN.LEFT_OUTER) .group_by(User.username)) You can order using the same COUNT expression used in the select clause. In the0 码力 | 221 页 | 844.06 KB | 1 年前3Django 4.2.x Documentation
Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Operations reference | SchemaEditor | Writing migrations Advanced: Managers | Raw SQL | Transactions | Aggregation | Search | Custom fields | Multiple databases | Custom lookups | Query Expressions | Conditional Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces0 码力 | 3305 页 | 3.16 MB | 1 年前3Django 5.1 Documentation
Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Operations reference | SchemaEditor | Writing migrations Advanced: Managers | Raw SQL | Transactions | Aggregation | Search | Custom fields | Multiple databases | Custom lookups | Query Expressions | Conditional Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces0 码力 | 3513 页 | 3.17 MB | 1 年前3Django 5.1.2 Documentation
Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Operations reference | SchemaEditor | Writing migrations Advanced: Managers | Raw SQL | Transactions | Aggregation | Search | Custom fields | Multiple databases | Custom lookups | Query Expressions | Conditional Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces0 码力 | 3519 页 | 3.17 MB | 1 年前3
共 502 条
- 1
- 2
- 3
- 4
- 5
- 6
- 51