def is_visible_if_hidden_q(prefix, user): if user.is_anonymous(): return Q() return ~prefix_q(prefix, status='deleted') & Project.is_visible_if_hidden_q( prefix + 'project__', user)
def is_visible_q(cls, prefix, user): if user.is_superuser: return Q() return Project.is_visible_q(prefix + 'project__', user) & ( prefix_q(prefix, status='active') | cls.is_visible_if_hidden_q(prefix, user))
def is_visible_q(cls, user): if user.is_superuser: return Q() return add_prefix('project', Project.is_visible_q(user)) & ( Q(status='active') | cls.is_visible_if_hidden_q(user) )
def is_visible_q(cls, prefix, user): if user.is_superuser: return Q() return Project.is_visible_q(prefix + 'project__', user) & ( prefix_q(prefix, status='active') | cls.is_visible_if_hidden_q(prefix, user) )
def is_visible_if_hidden_q(user): if user.is_anonymous(): return Q() return ~Q(status='deleted') & add_prefix('project', Project.is_visible_if_hidden_q(user))
def is_visible_if_hidden_q(prefix, user): if user.is_anonymous(): return Q() return ~prefix_q(prefix, status='deleted') & Project.is_visible_if_hidden_q(prefix + 'project__', user)