The castellan_ui.content.symmetric_keys.tables Module

The castellan_ui.content.symmetric_keys.tables Module

class castellan_ui.content.symmetric_keys.tables.DeleteSymmetricKey(**kwargs)[source]

Bases: horizon.tables.actions.DeleteAction

static action_past(count)[source]
static action_present(count)[source]
base_options = {'__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 ', '__init__': <function __init__ at 0x7fefeae638c0>, '__module__': 'castellan_ui.content.symmetric_keys.tables', '__repr__': <function __repr__ at 0x7fefeae61b18>, '_allowed': <function _allowed at 0x7fefeae63578>, '_get_action_name': <function _get_action_name at 0x7fefeae635f0>, 'action': <function action at 0x7fefeae63938>, 'action_past': <staticmethod object at 0x7fefea37c868>, 'action_present': <staticmethod object at 0x7fefea37c830>, 'allowed': <function allowed at 0x7fefeae618c0>, 'associate_with_table': <function associate_with_table at 0x7fefeae61b90>, 'base_options': {'__module__': 'horizon.tables.actions', 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'update': <function update at 0x7fefeae619b0>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'associate_with_table': <function associate_with_table at 0x7fefeae61b90>, '_allowed': <function _allowed at 0x7fefeae61938>, '__repr__': <function __repr__ at 0x7fefeae61b18>, 'allowed': <function allowed at 0x7fefeae618c0>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae61aa0>, 'base_options': {...}, '__doc__': 'Common base class for all ``Action`` classes.', '__init__': <function __init__ at 0x7fefeae61758>}, 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'delete': <function delete at 0x7fefea34ec08>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae637d0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'get_param_name': <function get_param_name at 0x7fefeae61c08>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'get_success_url': <function get_success_url at 0x7fefeae63758>, 'handle': <function handle at 0x7fefeae63848>, 'help_text': u'You should not delete a symmetric key unless you are certain it is not being used anywhere.', 'name': 'delete', 'policy_rules': (), 'update': <function update at 0x7fefeae636e0>}
delete(request, obj_id)[source]

Required. Deletes an object referenced by obj_id.

Override to provide delete functionality specific to your data.

help_text = u'You should not delete a symmetric key unless you are certain it is not being used anywhere.'
policy_rules = ()
class castellan_ui.content.symmetric_keys.tables.DownloadKey(attrs=None, **kwargs)[source]

Bases: horizon.tables.actions.LinkAction

base_options = {'__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 ', '__init__': <function __init__ at 0x7fefeae61c80>, '__module__': 'castellan_ui.content.symmetric_keys.tables', '__repr__': <function __repr__ at 0x7fefeae61b18>, '_allowed': <function _allowed at 0x7fefeae61938>, 'ajax': False, 'allowed': <function allowed at 0x7fefeae618c0>, 'associate_with_table': <function associate_with_table at 0x7fefeae61de8>, 'base_options': {'__module__': 'horizon.tables.actions', 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'update': <function update at 0x7fefeae619b0>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'associate_with_table': <function associate_with_table at 0x7fefeae61b90>, '_allowed': <function _allowed at 0x7fefeae61938>, '__repr__': <function __repr__ at 0x7fefeae61b18>, 'allowed': <function allowed at 0x7fefeae618c0>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae61aa0>, 'base_options': {...}, '__doc__': 'Common base class for all ``Action`` classes.', '__init__': <function __init__ at 0x7fefeae61758>}, 'classes': ('btn-download',), 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'get_ajax_update_url': <function get_ajax_update_url at 0x7fefeae61cf8>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae61aa0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'get_link_url': <function get_link_url at 0x7fefea34eaa0>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'name': 'download', 'policy_rules': (), 'render': <function render at 0x7fefeae61d70>, 'update': <function update at 0x7fefeae619b0>, 'url': 'horizon:project:symmetric_keys:download', 'verbose_name': u'Download Key'}
classes = ('btn-download',)
get_link_url(datum)[source]

Returns the final URL based on the value of url.

If url is callable it will call the function. If not, it will then try to call reverse on url. Failing that, it will simply return the value of url as-is.

When called for a row action, the current row data object will be passed as the first parameter.

name = 'download'
policy_rules = ()
url = 'horizon:project:symmetric_keys:download'
verbose_name = u'Download Key'
class castellan_ui.content.symmetric_keys.tables.GenerateSymmetricKey(attrs=None, **kwargs)[source]

Bases: horizon.tables.actions.LinkAction

base_options = {'__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 ', '__init__': <function __init__ at 0x7fefeae61c80>, '__module__': 'castellan_ui.content.symmetric_keys.tables', '__repr__': <function __repr__ at 0x7fefeae61b18>, '_allowed': <function _allowed at 0x7fefeae61938>, 'ajax': False, 'allowed': <function allowed at 0x7fefeae618c0>, 'associate_with_table': <function associate_with_table at 0x7fefeae61de8>, 'base_options': {'__module__': 'horizon.tables.actions', 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'update': <function update at 0x7fefeae619b0>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'associate_with_table': <function associate_with_table at 0x7fefeae61b90>, '_allowed': <function _allowed at 0x7fefeae61938>, '__repr__': <function __repr__ at 0x7fefeae61b18>, 'allowed': <function allowed at 0x7fefeae618c0>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae61aa0>, 'base_options': {...}, '__doc__': 'Common base class for all ``Action`` classes.', '__init__': <function __init__ at 0x7fefeae61758>}, 'classes': ('ajax-modal',), 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'get_ajax_update_url': <function get_ajax_update_url at 0x7fefeae61cf8>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae61aa0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'get_link_url': <function get_link_url at 0x7fefeae61e60>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'icon': 'plus', 'name': 'generate_symmetric_key', 'policy_rules': (), 'render': <function render at 0x7fefeae61d70>, 'update': <function update at 0x7fefeae619b0>, 'url': 'horizon:project:symmetric_keys:generate', 'verbose_name': u'Generate Symmetric Key'}
classes = ('ajax-modal',)
icon = 'plus'
name = 'generate_symmetric_key'
policy_rules = ()
url = 'horizon:project:symmetric_keys:generate'
verbose_name = u'Generate Symmetric Key'
class castellan_ui.content.symmetric_keys.tables.ImportSymmetricKey(attrs=None, **kwargs)[source]

Bases: horizon.tables.actions.LinkAction

base_options = {'__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 ', '__init__': <function __init__ at 0x7fefeae61c80>, '__module__': 'castellan_ui.content.symmetric_keys.tables', '__repr__': <function __repr__ at 0x7fefeae61b18>, '_allowed': <function _allowed at 0x7fefeae61938>, 'ajax': False, 'allowed': <function allowed at 0x7fefeae618c0>, 'associate_with_table': <function associate_with_table at 0x7fefeae61de8>, 'base_options': {'__module__': 'horizon.tables.actions', 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'update': <function update at 0x7fefeae619b0>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'associate_with_table': <function associate_with_table at 0x7fefeae61b90>, '_allowed': <function _allowed at 0x7fefeae61938>, '__repr__': <function __repr__ at 0x7fefeae61b18>, 'allowed': <function allowed at 0x7fefeae618c0>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae61aa0>, 'base_options': {...}, '__doc__': 'Common base class for all ``Action`` classes.', '__init__': <function __init__ at 0x7fefeae61758>}, 'classes': ('ajax-modal',), 'data_type_matched': <function data_type_matched at 0x7fefeae617d0>, 'get_ajax_update_url': <function get_ajax_update_url at 0x7fefeae61cf8>, 'get_default_attrs': <function get_default_attrs at 0x7fefeae61aa0>, 'get_default_classes': <function get_default_classes at 0x7fefeae61a28>, 'get_link_url': <function get_link_url at 0x7fefeae61e60>, 'get_policy_target': <function get_policy_target at 0x7fefeae61848>, 'icon': 'upload', 'name': 'import_symmetric_key', 'policy_rules': (), 'render': <function render at 0x7fefeae61d70>, 'update': <function update at 0x7fefeae619b0>, 'url': 'horizon:project:symmetric_keys:import', 'verbose_name': u'Import Symmetric Key'}
classes = ('ajax-modal',)
icon = 'upload'
name = 'import_symmetric_key'
policy_rules = ()
url = 'horizon:project:symmetric_keys:import'
verbose_name = u'Import Symmetric Key'
class castellan_ui.content.symmetric_keys.tables.SymmetricKeyTable(request, data=None, needs_form_wrapper=None, **kwargs)[source]

Bases: horizon.tables.base.DataTable

class Meta[source]

Bases: object

name = 'symmetric_key'
row_actions = (<class 'castellan_ui.content.symmetric_keys.tables.DownloadKey'>, <class 'castellan_ui.content.symmetric_keys.tables.DeleteSymmetricKey'>)
table_actions = (<class 'castellan_ui.content.symmetric_keys.tables.GenerateSymmetricKey'>, <class 'castellan_ui.content.symmetric_keys.tables.ImportSymmetricKey'>, <class 'castellan_ui.content.symmetric_keys.tables.DeleteSymmetricKey'>)
base_actions = {'delete': <DeleteSymmetricKey: delete>, 'download': <DownloadKey: download>, 'generate_symmetric_key': <GenerateSymmetricKey: generate_symmetric_key>, 'import_symmetric_key': <ImportSymmetricKey: import_symmetric_key>}
base_columns = {'algorithm': <Column: algorithm>, 'bit_length': <Column: bit_length>, 'created_date': <Column: created_date>, 'name': <Column: name>, 'uuid': <Column: uuid>}
detail_link = 'horizon:project:symmetric_keys:detail'
get_object_display(datum)[source]

Returns a display name that identifies this object.

By default, this returns a name attribute from the given object, but this can be overridden to return other values.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.