The blazar_dashboard.content.leases.tables ModuleΒΆ

class blazar_dashboard.content.leases.tables.CreateLease(attrs=None, **kwargs)[source]

Bases: horizon.tables.actions.LinkAction

base_options = {'__module__': 'blazar_dashboard.content.leases.tables', 'render': <function render>, 'update': <function update>, 'get_link_url': <function get_link_url>, 'ajax': False, 'allowed': <function allowed>, 'base_options': {'__module__': 'horizon.tables.actions', 'data_type_matched': <function data_type_matched>, 'get_default_classes': <function get_default_classes>, 'update': <function update>, 'get_policy_target': <function get_policy_target>, 'associate_with_table': <function associate_with_table>, '_allowed': <function _allowed>, '__repr__': <function __repr__>, 'allowed': <function allowed>, 'get_default_attrs': <function get_default_attrs>, 'base_options': {...}, '__doc__': 'Common base class for all ``Action`` classes.', '__init__': <function __init__>}, 'get_default_attrs': <function get_default_attrs>, '__init__': <function __init__>, 'icon': 'plus', 'name': 'create', 'url': 'horizon:project:leases:create', 'data_type_matched': <function data_type_matched>, 'get_default_classes': <function get_default_classes>, 'get_policy_target': <function get_policy_target>, 'associate_with_table': <function associate_with_table>, '_allowed': <function _allowed>, 'classes': ('ajax-modal',), '__repr__': <function __repr__>, 'get_ajax_update_url': <function get_ajax_update_url>, 'verbose_name': u'Create Lease', '__doc__': 'A table action which is simply a link rather than a form POST.\n\n .. attribute:: name\n\n Required. The short name or "slug" representing this\n action. This name should not be changed at runtime.\n\n .. attribute:: verbose_name\n\n A string which will be rendered as the link text. (Required)\n\n .. attribute:: url\n\n A string or a callable which resolves to a url to be used as the link\n target. You must either define the ``url`` attribute or override\n the ``get_link_url`` method on the class.\n\n .. attribute:: allowed_data_types\n\n A list that contains the allowed data types of the action. If the\n datum\'s type is in this list, the action will be shown on the row\n for the datum.\n\n Defaults to be an empty list (``[]``). When set to empty, the action\n will accept any kind of data.\n '}
classes = ('ajax-modal',)
icon = 'plus'
name = 'create'
url = 'horizon:project:leases:create'
verbose_name = u'Create Lease'
class blazar_dashboard.content.leases.tables.DeleteLease(**kwargs)[source]

Bases: horizon.tables.actions.DeleteAction

static action_past(count)[source]
static action_present(count)[source]
base_options = {'__module__': 'blazar_dashboard.content.leases.tables', 'handle': <function handle>, 'data_type_singular': u'Lease', 'update': <function update>, 'get_success_url': <function get_success_url>, 'get_param_name': <function get_param_name>, 'allowed': <function allowed>, 'help_text': u'This action cannot be undone.', 'base_options': {'__module__': 'horizon.tables.actions', 'data_type_matched': <function data_type_matched>, 'get_default_classes': <function get_default_classes>, 'update': <function update>, 'get_policy_target': <function get_policy_target>, 'associate_with_table': <function associate_with_table>, '_allowed': <function _allowed>, '__repr__': <function __repr__>, 'allowed': <function allowed>, 'get_default_attrs': <function get_default_attrs>, 'base_options': {...}, '__doc__': 'Common base class for all ``Action`` classes.', '__init__': <function __init__>}, '__init__': <function __init__>, 'name': 'delete', 'data_type_plural': u'Leases', 'action_present': <staticmethod object>, 'action_past': <staticmethod object>, 'data_type_matched': <function data_type_matched>, 'get_default_classes': <function get_default_classes>, 'get_policy_target': <function get_policy_target>, 'associate_with_table': <function associate_with_table>, '_allowed': <function _allowed>, 'classes': ('btn-danger', 'btn-terminate'), '_get_action_name': <function _get_action_name>, '__repr__': <function __repr__>, 'action': <function action>, 'get_default_attrs': <function get_default_attrs>, '__doc__': 'A table action used to perform delete operations on table data.\n\n .. attribute:: name\n\n A short name or "slug" representing this action.\n Defaults to \'delete\'\n\n .. method:: action_present\n\n Method returning a present action name. This is used as an action label.\n\n Method must accept an integer/long parameter and return the display\n forms of the name properly pluralised (depending on the integer) and\n translated in a string or tuple/list.\n\n The returned display form is highly recommended to be a complete action\n name with a form of a transitive verb and an object noun. Each word is\n capitalized and the string should be marked as translatable.\n\n If tuple or list - then setting self.current_present_action = n will\n set the current active item from the list(action_present[n])\n\n .. method:: action_past\n\n Method returning a past action name. This is usually used to display\n a message when the action is completed.\n\n Method must accept an integer/long parameter and return the display\n forms of the name properly pluralised (depending on the integer) and\n translated in a string or tuple/list.\n\n The detail is same as that of ``action_present``.\n\n .. attribute:: success_url\n\n Optional location to redirect after completion of the delete\n action. Defaults to the current page.\n\n .. attribute:: help_text\n\n Optional message for providing an appropriate help text for\n the horizon user.\n\n ', 'delete': <function delete>}
classes = ('btn-danger', 'btn-terminate')
data_type_plural = u'Leases'
data_type_singular = u'Lease'
delete(request, lease_id)[source]
name = 'delete'
class blazar_dashboard.content.leases.tables.LeasesTable(request, data=None, needs_form_wrapper=None, **kwargs)[source]

Bases: horizon.tables.base.DataTable

class Meta[source]

Bases: object

name = 'leases'
row_actions = (<class 'blazar_dashboard.content.leases.tables.UpdateLease'>, <class 'blazar_dashboard.content.leases.tables.DeleteLease'>)
table_actions = (<class 'blazar_dashboard.content.leases.tables.CreateLease'>, <class 'blazar_dashboard.content.leases.tables.DeleteLease'>)
verbose_name = u'Leases'
base_actions = OrderedDict([('create', <CreateLease: create>), ('delete', <DeleteLease: delete>), ('update', <UpdateLease: update>)])
base_columns = OrderedDict([('name', <Column: name>), ('start_date', <Column: start_date>), ('end_date', <Column: end_date>), ('action', <Column: action>), ('status', <Column: status>), ('status_reason', <Column: status_reason>)])
class blazar_dashboard.content.leases.tables.UpdateLease(attrs=None, **kwargs)[source]

Bases: horizon.tables.actions.LinkAction

allowed(request, lease)[source]
base_options = {'__module__': 'blazar_dashboard.content.leases.tables', 'render': <function render>, 'update': <function update>, 'get_link_url': <function get_link_url>, 'ajax': False, 'allowed': <function allowed>, 'base_options': {'__module__': 'horizon.tables.actions', 'data_type_matched': <function data_type_matched>, 'get_default_classes': <function get_default_classes>, 'update': <function update>, 'get_policy_target': <function get_policy_target>, 'associate_with_table': <function associate_with_table>, '_allowed': <function _allowed>, '__repr__': <function __repr__>, 'allowed': <function allowed>, 'get_default_attrs': <function get_default_attrs>, 'base_options': {...}, '__doc__': 'Common base class for all ``Action`` classes.', '__init__': <function __init__>}, 'get_default_attrs': <function get_default_attrs>, '__init__': <function __init__>, 'name': 'update', 'url': 'horizon:project:leases:update', 'data_type_matched': <function data_type_matched>, 'get_default_classes': <function get_default_classes>, 'get_policy_target': <function get_policy_target>, 'associate_with_table': <function associate_with_table>, '_allowed': <function _allowed>, 'classes': ('btn-create', 'ajax-modal'), '__repr__': <function __repr__>, 'get_ajax_update_url': <function get_ajax_update_url>, 'verbose_name': u'Update Lease', '__doc__': 'A table action which is simply a link rather than a form POST.\n\n .. attribute:: name\n\n Required. The short name or "slug" representing this\n action. This name should not be changed at runtime.\n\n .. attribute:: verbose_name\n\n A string which will be rendered as the link text. (Required)\n\n .. attribute:: url\n\n A string or a callable which resolves to a url to be used as the link\n target. You must either define the ``url`` attribute or override\n the ``get_link_url`` method on the class.\n\n .. attribute:: allowed_data_types\n\n A list that contains the allowed data types of the action. If the\n datum\'s type is in this list, the action will be shown on the row\n for the datum.\n\n Defaults to be an empty list (``[]``). When set to empty, the action\n will accept any kind of data.\n '}
classes = ('btn-create', 'ajax-modal')
name = 'update'
url = 'horizon:project:leases:update'
verbose_name = u'Update Lease'