#NEWLINE# @ staticmethod #NEWLINE# def select_by_user( user ) : #NEWLINE# #INDENT# if user . is_admin : #NEWLINE# #INDENT# qs = ControllerSlicePrivilege . objects . all ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cpriv_ids = [ cp . id for cp in ControllerSlicePrivilege . objects . filter ( slice_privilege__user = user ) ] #NEWLINE# qs = ControllerSlicePrivilege . objects . filter ( id__in = cpriv_ids ) #NEWLINE# #UNINDENT# return qs