choices.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. from django.utils.translation import gettext_lazy as _
  2. from utilities.choices import ChoiceSet
  3. #
  4. # Clusters
  5. #
  6. class ClusterStatusChoices(ChoiceSet):
  7. key = 'Cluster.status'
  8. STATUS_PLANNED = 'planned'
  9. STATUS_STAGING = 'staging'
  10. STATUS_ACTIVE = 'active'
  11. STATUS_DECOMMISSIONING = 'decommissioning'
  12. STATUS_OFFLINE = 'offline'
  13. CHOICES = [
  14. (STATUS_PLANNED, _('Planned'), 'cyan'),
  15. (STATUS_STAGING, _('Staging'), 'blue'),
  16. (STATUS_ACTIVE, _('Active'), 'green'),
  17. (STATUS_DECOMMISSIONING, _('Decommissioning'), 'yellow'),
  18. (STATUS_OFFLINE, _('Offline'), 'red'),
  19. ]
  20. #
  21. # VirtualMachines
  22. #
  23. class VirtualMachineStatusChoices(ChoiceSet):
  24. key = 'VirtualMachine.status'
  25. STATUS_OFFLINE = 'offline'
  26. STATUS_ACTIVE = 'active'
  27. STATUS_PLANNED = 'planned'
  28. STATUS_STAGED = 'staged'
  29. STATUS_FAILED = 'failed'
  30. STATUS_DECOMMISSIONING = 'decommissioning'
  31. CHOICES = [
  32. (STATUS_OFFLINE, _('Offline'), 'gray'),
  33. (STATUS_ACTIVE, _('Active'), 'green'),
  34. (STATUS_PLANNED, _('Planned'), 'cyan'),
  35. (STATUS_STAGED, _('Staged'), 'blue'),
  36. (STATUS_FAILED, _('Failed'), 'red'),
  37. (STATUS_DECOMMISSIONING, _('Decommissioning'), 'yellow'),
  38. ]