object_actions.py 543 B

1234567891011121314151617181920212223
  1. from django.utils.translation import gettext as _
  2. from netbox.object_actions import ObjectAction
  3. __all__ = (
  4. 'BulkAddComponents',
  5. )
  6. class BulkAddComponents(ObjectAction):
  7. """
  8. Add components to the selected virtual machines.
  9. """
  10. label = _('Add Components')
  11. multi = True
  12. permissions_required = {'change'}
  13. template_name = 'virtualization/buttons/bulk_add_components.html'
  14. @classmethod
  15. def get_context(cls, context, obj):
  16. return {
  17. 'formaction': context.get('formaction'),
  18. }