mirror of https://github.com/jumpserver/jumpserver
perf: Account backup filter org
parent
88905bd28d
commit
4018a59b2e
|
@ -14,13 +14,17 @@ from common.db import fields
|
|||
from common.db.encoder import ModelJSONFieldEncoder
|
||||
from common.utils import get_logger, lazyproperty
|
||||
from ops.mixin import PeriodTaskModelMixin
|
||||
from orgs.mixins.models import OrgModelMixin, JMSOrgBaseModel
|
||||
from orgs.mixins.models import OrgModelMixin, JMSOrgBaseModel, OrgManager
|
||||
|
||||
__all__ = ['AccountBackupAutomation', 'AccountBackupExecution']
|
||||
|
||||
logger = get_logger(__file__)
|
||||
|
||||
|
||||
class BaseBackupAutomationManager(OrgManager):
|
||||
pass
|
||||
|
||||
|
||||
class AccountBackupAutomation(PeriodTaskModelMixin, JMSOrgBaseModel):
|
||||
types = models.JSONField(default=list)
|
||||
backup_type = models.CharField(max_length=128, choices=AccountBackupType.choices,
|
||||
|
@ -47,6 +51,8 @@ class AccountBackupAutomation(PeriodTaskModelMixin, JMSOrgBaseModel):
|
|||
max_length=4096, blank=True, null=True, verbose_name=_('Zip encrypt password')
|
||||
)
|
||||
|
||||
objects = BaseBackupAutomationManager.from_queryset(models.QuerySet)()
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.name}({self.org_id})'
|
||||
|
||||
|
|
Loading…
Reference in New Issue