|
|
|
@ -83,8 +83,9 @@ def member_count(group_id):
|
|
|
|
|
group = UserGroup.objects.get(id=group_id)
|
|
|
|
|
return group.user_set.count()
|
|
|
|
|
|
|
|
|
|
@register.filter(name='dept_member')
|
|
|
|
|
def dept_member(dept_id):
|
|
|
|
|
|
|
|
|
|
@register.filter(name='dept_user_num')
|
|
|
|
|
def dept_user_num(dept_id):
|
|
|
|
|
dept = DEPT.objects.filter(id=dept_id)
|
|
|
|
|
if dept:
|
|
|
|
|
dept = dept[0]
|
|
|
|
@ -93,14 +94,24 @@ def dept_member(dept_id):
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register.filter(name='dept_group_num')
|
|
|
|
|
def dept_group_num(dept_id):
|
|
|
|
|
dept = DEPT.objects.filter(id=dept_id)
|
|
|
|
|
if dept:
|
|
|
|
|
dept = dept[0]
|
|
|
|
|
return dept.usergroup_set.all().count()
|
|
|
|
|
else:
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register.filter(name='perm_count')
|
|
|
|
|
def perm_count(group_id):
|
|
|
|
|
group = UserGroup.objects.get(id=group_id)
|
|
|
|
|
return group.perm_set.count()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@register.filter(name='dept_perm_count')
|
|
|
|
|
def dept_perm_count(dept_id):
|
|
|
|
|
@register.filter(name='dept_asset_num')
|
|
|
|
|
def dept_asset_num(dept_id):
|
|
|
|
|
dept = DEPT.objects.filter(id=dept_id)
|
|
|
|
|
if dept:
|
|
|
|
|
dept = dept[0]
|
|
|
|
|