Conversation
|
I thought i would give a run down of how this feature works. Within the 'JAZZMIN_UI_TWEAKS' dictionary the user needs to provide a customized version of the following dictionary for each metric of each model they wish: Dictionary format details: Key - Must be model name in lowercase 'e.g order' Metric Dictionary Key Values "metric" - [required] this can be one of the following values ['avg', sum', 'min', 'max', 'count' ] "method" - (optional) This is a custom method used to get some value for a special user defined metric, this method must be part of the class of the related model "e.g. 'get_total_cost' belongs to the Order class" "icon" - (optional) Font Awsome (FA) icon title (default val: 'info' ) "format-pre" - (optional) Format prefix, used to show any string before the value of the metric 'e.g. $100' "column" - column name to search within to get metric value 'e.g. status, "date_range": (optional) Used to define the date range for the metric card, if no date range if provided then all entries from db table will be used for metric Date Range Examples: Example dictionary: From this dictionary the 'Simple Metric' cards are built. Feel free to ask anything else you want to know. |
This is my implementation of a feature designed to provide a quick, flexible method of adding metrics to the top of a model card on the dashboard overview page
