peewee Documentation Release 2.10.2necessary to wrap your query and apply a count to the rows of the inner query (such as when using DISTINCT or GROUP BY). Peewee will usually do this automatically, but in some cases you may need to manually retrieve scalar values by calling Query.scalar(). For instance: >>> PageView.select(fn.Count(fn.Distinct(PageView.url))).scalar() 100 You can retrieve multiple scalar values by passing as_tuple=True: isolation level) aggregate([name=None[, num_params=-1]]) Class-decorator for registering custom aggregation functions. name – string name for the aggregate, defaults to the name of the class. num_params0 码力 | 275 页 | 276.96 KB | 1 年前3
peewee Documentation
Release 2.10.2necessary to wrap your query and apply a count to the rows of the inner query (such as when using DISTINCT or GROUP BY). Peewee will usually do this automatically, but in some cases you may need to manually retrieve scalar values by calling Query.scalar(). For instance: >>> PageView.select(fn.Count(fn.Distinct(PageView.url))).scalar() 100 You can retrieve multiple scalar values by passing as_tuple=True: Release 2.10.2 aggregate([name=None[, num_params=-1]]) Class-decorator for registering custom aggregation functions. Parameters • name – string name for the aggregate, defaults to the name of the class0 码力 | 221 页 | 844.06 KB | 1 年前3
peewee Documentation Release 0.9.7complex of the 4 query classes available in peewee. It supports JOIN operations on other tables, aggregation via GROUP BY and HAVING clauses, ordering via ORDER BY, and can be iterated and sliced to return annotate(related_model, aggregation=None) Parameters: related_model – related Model on which to perform aggregation, must be linked by ForeignKeyField. aggregation – the type of aggregation to use, e.g. Max('pub_date' Annotate a query with an aggregation performed on a related model, for example, “get a list of blogs with the number of entries on each”: >>> Blog.select().annotate(Entry) if aggregation is None, it will default0 码力 | 78 页 | 143.68 KB | 1 年前3
peewee Documentation Release 1.0.0complex of the 4 query classes available in peewee. It supports JOIN operations on other tables, aggregation via GROUP BY and HAVING clauses, ordering via ORDER BY, and can be iterated and sliced to return annotate(related_model, aggregation=None) Parameters: related_model – related Model on which to perform aggregation, must be linked by ForeignKeyField. aggregation – the type of aggregation to use, e.g. Max('pub_date' Annotate a query with an aggregation performed on a related model, for example, “get a list of blogs with the number of entries on each”: >>> Blog.select().annotate(Entry) if aggregation is None, it will default0 码力 | 101 页 | 163.20 KB | 1 年前3
Django 4.2.x DocumentationGet 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 年前3
Django 5.1 DocumentationGet 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 年前3
Django 5.1.2 DocumentationGet 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
Django 5.0.x DocumentationGet 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 码力 | 3407 页 | 3.21 MB | 1 年前3
peewee Documentation
Release 0.9.7complex of the 4 query classes available in peewee. It supports JOIN operations on other tables, aggregation via GROUP BY and HAVING clauses, ordering via ORDER BY, and can be iterated and sliced to return annotate(related_model, aggregation=None) Parameters • related_model – related Model on which to perform aggregation, must be linked by ForeignKeyField. • aggregation – the type of aggregation to use, e.g. Max(’pub_date’ Annotate a query with an aggregation performed on a related model, for example, “get a list of blogs with the number of entries on each”: >>> Blog.select().annotate(Entry) if aggregation is None, it will default0 码力 | 53 页 | 347.03 KB | 1 年前3
Django 5.1.2 Documentationreference | SchemaEditor | Writing migrations • Advanced: Managers | Raw SQL | Transactions | Aggregation | Search | Custom fields | Multiple databases | Custom lookups | Query Expressions | Conditional QuerySet that is in no way bound to the previous QuerySet. Each refinement creates a separate and distinct QuerySet that can be stored, used and reused. Example: >>> q1 = Entry.objects.filter(headline database. 170 Chapter 3. Using Django Django Documentation, Release 5.1.2.dev20240916204136 3.2.3 Aggregation The topic guide on Django’s database-abstraction API described the way that you can use Django0 码力 | 2923 页 | 9.62 MB | 1 年前3
共 834 条
- 1
- 2
- 3
- 4
- 5
- 6
- 84













