postgres_metrics.templatetags.postgres_metrics module

postgres_metrics.templatetags.postgres_metrics.get_postgres_metrics(context)[source]

Return an iterable over all registered metrics, sorted by their label.

The template tag will filter out all metrics the current user does not have access to.

See MetricRegistry.sorted for details.

postgres_metrics.templatetags.postgres_metrics.record_item_style(context)[source]

Return the style to be usd for the metric’s current record specific item.

Like the record_style() template tag, this expects a template context variable 'metric' referring to the metric instance in question, as well as a context variable 'record' containing the current record. Furthermore, the 'forloop.counter0' context is expected with the current column index to be styled. This mean, for styling, unline on the SQL column numbering, columns are zero-indexed.

This template tag calls into Metric.get_record_item_style and will—if a return value was specified—prefix that one with 'pgm-'.

postgres_metrics.templatetags.postgres_metrics.record_style(context)[source]

Return the style to be usd for the metric’s current record.

This expects a template context variable 'metric' referring to the metric instance in question, as well as a context variable 'record' containing the current record to be used for style determination.

This template tag calls into Metric.get_record_style and will—if a return value was specified—prefix that one with 'pgm-'.