Add widget support to SourceColumn
Allow passing a widget class to SourceColumn. This makes using lambdas to render model column unnecesary and are mostly removed too. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
18
mayan/apps/user_management/utils.py
Normal file
18
mayan/apps/user_management/utils.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.apps import apps
|
||||
from django.contrib.auth import get_user_model
|
||||
|
||||
|
||||
def get_groups():
|
||||
Group = apps.get_model(app_label='auth', model_name='Group')
|
||||
return ','.join([group.name for group in Group.objects.all()])
|
||||
|
||||
|
||||
def get_users():
|
||||
return ','.join(
|
||||
[
|
||||
user.get_full_name() or user.username
|
||||
for user in get_user_model().objects.all()
|
||||
]
|
||||
)
|
||||
Reference in New Issue
Block a user