예제 #1
0
파일: api.py 프로젝트: serge-gaia/biosys
 def get_object_list(self, request):
     """Filter the queryset based upon the request user.
     """
     object_list = super(AbstractVegObservationResource, self).get_object_list(request)
     if readonly_user(request.user):
         return object_list.filter(vegetation_visit__site_visit__data_status='approved')
     else:
         return object_list
예제 #2
0
파일: views.py 프로젝트: serge-gaia/biosys
 def get_context_data(self, **kwargs):
     context = super(DashboardView, self).get_context_data(**kwargs)
     context['readonly_user'] = readonly_user(self.request.user)
     return context