2022-08-18 03:15:17 +00:00
|
|
|
from django.db import models
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
|
2022-12-20 12:23:42 +00:00
|
|
|
from common.db.models import JMSBaseModel
|
2022-08-18 03:15:17 +00:00
|
|
|
from orgs.mixins.models import OrgModelMixin
|
|
|
|
|
|
|
|
|
2022-12-20 12:23:42 +00:00
|
|
|
class Application(JMSBaseModel, OrgModelMixin):
|
2022-08-18 03:15:17 +00:00
|
|
|
name = models.CharField(max_length=128, verbose_name=_('Name'))
|
|
|
|
category = models.CharField(
|
|
|
|
max_length=16, verbose_name=_('Category')
|
|
|
|
)
|
|
|
|
type = models.CharField(
|
|
|
|
max_length=16, verbose_name=_('Type')
|
|
|
|
)
|
|
|
|
attrs = models.JSONField(default=dict, verbose_name=_('Attrs'))
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
verbose_name = _('Application')
|
|
|
|
unique_together = [('org_id', 'name')]
|
|
|
|
ordering = ('name',)
|
|
|
|
permissions = [
|
|
|
|
('match_application', _('Can match application')),
|
|
|
|
]
|