views.py 425 Bytes
Newer Older
Benoit Alessandroni's avatar
Benoit Alessandroni committed
1 2 3 4 5 6 7 8
from djangoldp.views import LDPViewSet
from .models import Resource

class PendingResourcesViewSet(LDPViewSet):
  model = Resource

  def get_queryset(self, *args, **kwargs):
    return super().get_queryset(*args, **kwargs)\
9
          .filter(review=None, language__in=self.request.user.mentor_profile.languages.all(), fields__in=self.request.user.mentor_profile.fields.all())\
Benoit Alessandroni's avatar
Benoit Alessandroni committed
10
          .exclude(submitter=self.request.user)