Premium
FieldAggregation Whitelist
FieldAggregation accepts:
name– field name on the model. Relation paths are supported using__(e.g."category__name").label– optional label exposed via the aggregate schema endpoint.aggregations– list ofAggregateFunctionTypemembers allowed when this field is the target offunction=. Empty means the field is not aggregable.group_by– list ofGroupByTypemembers allowed when the field appears in thegroup_byquery parameter. Empty means the field cannot be used to group.prefix/postfix– optional strings rendered before / after the field's value. Exposed under the schemaoptionskey exactly likeFieldSchema(e.g. a currency symbol or unit such as" Kč").
Validation runs at admin registration time, as validate_aggregate_fields() on
habarico_enterprise.validation.AdminConfigurationValidator — the validator
validate_configuration() delegates to. When a function or bucket
form does not apply to the field's underlying Django type (e.g. SUM on a CharField,
TRUNC_DAY on an IntegerField, WIDTH on a DateTimeField), the admin
fails to register with ImproperlyConfigured rather than surfacing the error at
request time.
count is always available when aggregate_enabled = True and does not require
an entry in aggregate_fields – it simply counts the rows in the filtered
queryset.