Grids

class keg_auth.grids.ActionColumn(label, key=None, filter=None, can_sort=False, render_in=('html', ), has_subtotal=False, edit_endpoint=None, delete_endpoint=None, view_endpoint=None, edit_permission_for=<function ActionColumn.<lambda>>, delete_permission_for=<function ActionColumn.<lambda>>, view_permission_for=<function ActionColumn.<lambda>>, view_link_class_for=None, edit_link_class_for=None, delete_link_class_for=None, **kwargs)

Places various action buttons in a Column.

Parameters:
  • edit_permission_for – is a function that takes a row and returns the permission required to open the edit endpoint for that row.
  • delete_permission_for – is like edit_permission_for, but for the delete endpoint.
  • view_permission_for – is like edit_permission_for, but for the view endpoint.
  • view_link_class_for – is a function that takes a row and returns the HTML class to place on the view link.
  • edit_link_class_for – is a function that takes a row and returns the HTML class to place on the edit link.
  • delete_link_class_for – is a function that takes a row and returns the HTML class to place on the delete link.
extract_and_format_data(record)

Extract a value from the record for this column and run it through the data formaters.

format_data(value, show_edit, show_delete, show_view, view_link_class, edit_link_class, delete_link_class)

Use to adjust the value extracted from the record for this column. By default, no change is made. Useful in sub-classes.

keg_auth.grids.make_bundle_grid(edit_endpoint, edit_permission, delete_endpoint, delete_permission, grid_cls=None)

Factory method to create a Bundle grid class for CRUD.

keg_auth.grids.make_group_grid(edit_endpoint, edit_permission, delete_endpoint, delete_permission, grid_cls=None)

Factory method to create a Group grid class for CRUD.

keg_auth.grids.make_permission_grid(grid_cls=None)

Factory method to create a Permission grid class.

keg_auth.grids.make_user_grid(edit_endpoint, edit_permission, delete_endpoint, delete_permission, grid_cls=None, resend_verification_endpoint=None)

Factory method to create a User grid class for CRUD.