castellan_ui.content.private_keys.tables
Module¶castellan_ui.content.private_keys.tables.
DeletePrivateKey
(**kwargs)[source]Bases: horizon.tables.actions.DeleteAction
action_past
(count)[source]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.private_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 0x7fefea3bc590>, 'action_present': <staticmethod object at 0x7fefea3bc558>, '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 0x7fefea3be758>, '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 private key unless you are certain it is not being used anywhere. If there was a public key generated with this private key, it will not be deleted.', '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 private key unless you are certain it is not being used anywhere. If there was a public key generated with this private key, it will not be deleted.'policy_rules
= ()castellan_ui.content.private_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.private_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 0x7fefea3be5f0>, '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:private_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:private_keys:download'verbose_name
= u'Download Key'castellan_ui.content.private_keys.tables.
GeneratePrivateKey
(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.private_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_private_key', 'policy_rules': (), 'render': <function render at 0x7fefeae61d70>, 'update': <function update at 0x7fefeae619b0>, 'url': 'horizon:project:private_keys:generate', 'verbose_name': u'Generate Key Pair'}classes
= ('ajax-modal',)icon
= 'plus'name
= 'generate_private_key'policy_rules
= ()url
= 'horizon:project:private_keys:generate'verbose_name
= u'Generate Key Pair'castellan_ui.content.private_keys.tables.
ImportPrivateKey
(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.private_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_private_key', 'policy_rules': (), 'render': <function render at 0x7fefeae61d70>, 'update': <function update at 0x7fefeae619b0>, 'url': 'horizon:project:private_keys:import', 'verbose_name': u'Import Private Key'}classes
= ('ajax-modal',)icon
= 'upload'name
= 'import_private_key'policy_rules
= ()url
= 'horizon:project:private_keys:import'verbose_name
= u'Import Private Key'castellan_ui.content.private_keys.tables.
PrivateKeyTable
(request, data=None, needs_form_wrapper=None, **kwargs)[source]Bases: horizon.tables.base.DataTable
Meta
[source]Bases: object
name
= 'private_key'row_actions
= (<class 'castellan_ui.content.private_keys.tables.DownloadKey'>, <class 'castellan_ui.content.private_keys.tables.DeletePrivateKey'>)table_actions
= (<class 'castellan_ui.content.private_keys.tables.GeneratePrivateKey'>, <class 'castellan_ui.content.private_keys.tables.ImportPrivateKey'>, <class 'castellan_ui.content.private_keys.tables.DeletePrivateKey'>)base_actions
= {'delete': <DeletePrivateKey: delete>, 'download': <DownloadKey: download>, 'generate_private_key': <GeneratePrivateKey: generate_private_key>, 'import_private_key': <ImportPrivateKey: import_private_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:private_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.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.