the policy_rules of column

asked 2018-07-29 04:47:53 -0500

i want to make some column only can be seen by admin.So I find a argument in datatable.column like following: class horizon.tables.Column(transform, verbose_name=None, sortable=True, link=None, allowed_data_types=None, hidden=False, attrs=None, status=False, status_choices=None, display_choices=None, empty_value=None, filters=None, classes=None, summation=None, auto=None, truncate=None, link_classes=None, wrap_list=False, form_field=None, form_field_attributes=None, update_action=None, link_attrs=None, policy_rules=None, cell_attributes_getter=None, help_text=None) And i change the column like created = tables.Column("created", verbose_name=_("Time since created"), filters=(filters.parse_isotime, filters.timesince_sortable), attrs={'data-type': 'timesince'}, policy_rules=(("identity", "identity:get_role"),))

but it failed maybe it is a bug I want to know whether there are other methods to solve my question! My English is not very good and Thanks any way please help me

edit retag flag offensive close merge delete