示例#1
0
 class Meta:
     queryset = Course.objects.all()
     resource_name = 'course'
     allowed_methods = ['get']
     excludes = ['certification_banner']
     authentication = MultiAuthentication(DjangoAuthentication(),
                                          ApiKeyAuthentication())
     authorization = DjangoAuthorization()
示例#2
0
 class Meta:
     queryset = Reservation.objects.all()
     resource_name = 'reservation'
     allowed_methods = ['get']
     authentication = MultiAuthentication(DjangoAuthentication(),
                                          ApiKeyAuthentication())
     authorization = DjangoAuthorization()
     filtering = {
         "asset": ('exact'),
         "user": ('exact'),
         "reserved_from": ('exact'),
     }
示例#3
0
 class Meta:
     resource_name = 'user'
     queryset = User.objects.all()
     allowed_methods = ['get']
     authentication = MultiAuthentication(TeacherAuthentication(),
                                          ApiKeyAuthentication())
     authorization = UserResourceAuthorization()
     fields = ['id', 'email', 'first_name', 'last_name']
     filtering = {
         'first_name': ['istartswith'],
         'last_name': ['istartswith'],
         'email': ('iexact')
     }