@register.filter(name='role_contain_which_sudos')
def role_contain_which_sudos(role):
 sudo_names = [sudo.name for sudo in role.sudo.all()]
 return ','.join(sudo_names)

@ register . filter ( name = 'role_contain_which_sudos' ) def role_contain_which_sudos ( role ) : sudo_names = [ sudo . name for sudo in role . sudo . all ( ) ] return ',' . join ( sudo_names )
get role sudo commands .