mirror of
https://github.com/dkmstr/openuds.git
synced 2025-03-13 08:58:35 +03:00
Added calendars new colums with rules, pools with access and pools with rules
This commit is contained in:
parent
859f09aa0b
commit
d22f606f49
@ -68,6 +68,9 @@ class Calendars(ModelHandler):
|
||||
},
|
||||
{'comments': {'title': _('Comments')}},
|
||||
{'modified': {'title': _('Modified'), 'type': 'datetime'}},
|
||||
{'number_rules': {'title': _('Rules')}},
|
||||
{'number_access': {'title': _('Pools with Accesses')}},
|
||||
{'number_actions': {'title': _('Pools with Actions')}},
|
||||
{'tags': {'title': _('tags'), 'visible': False}},
|
||||
]
|
||||
|
||||
@ -78,6 +81,10 @@ class Calendars(ModelHandler):
|
||||
'tags': [tag.tag for tag in item.tags.all()],
|
||||
'comments': item.comments,
|
||||
'modified': item.modified,
|
||||
'number_rules': item.rules.count(),
|
||||
'number_access': item.calendaraccess_set.all().values('service_pool').distinct().count(),
|
||||
'number_actions': item.calendaraction_set.all().values('service_pool').distinct().count(),
|
||||
|
||||
'permission': permissions.getEffectivePermission(self._user, item),
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,7 @@ class Calendar(UUIDModel, TaggingMixin):
|
||||
objects: 'models.BaseManager[Calendar]'
|
||||
rules: 'models.QuerySet[CalendarRule]'
|
||||
calendaraction_set: 'models.QuerySet[CalendarAction]'
|
||||
calendaraccess_set: 'models.QuerySet[CalendarAccess]'
|
||||
|
||||
class Meta:
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user