Beispiel #1
0
    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)
Beispiel #2
0
    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))
Beispiel #3
0
    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)
        )
Beispiel #4
0
    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)
        )
Beispiel #5
0
    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))
Beispiel #6
0
    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)