order_by the model field (str) or fields (list) to order the table by when loading (by default ascending alphanumeric order, for descending order use the prefix "-" (e.g. "-id"))
is_empty sets whether the table should be empty by default until the user clicks the Search button (must have a selectpickers section on top of the page)
init_max_rows_threshold the maximum number of rows that will be displayed without the user clicking the Search button
table_settings the table-level configuration
field_definition column showed in the table from the model
limit: The maximum number of rows showed in the table
Since it is using the custom_views, the custom_views can be defined as followed:
class RegularTableEdbCalculation(module_views.RegularTable):
def get_cell_style(self, field_name, value, item):
if field_name in [
"social_and_labor",
"health_and_safety",
"environment",
"total_risk_exposure_score",
]:
if value < 3:
return "color: #FF8463;"
elif value < 6:
return "color: #FFC863;"
else:
return "color: #63FF63;"
The regular table can have colors in some field in the regular table.