views.py 457 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__status='pending', language__in=self.request.user.mentor_profile.languages.all(), fields__in=self.request.user.mentor_profile.fields.all())\
10
          .exclude(submitter__username=self.request.user.username)