コード例 #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 = Attachment.objects.all()
     resource_name = 'attachment'
     authentication = DjangoAuthentication()
     authorization = PublicReadTeachersModifyAuthorization()
     filtering = {
         "kq": ('exact'),
     }
コード例 #3
0
 class Meta:
     queryset = KnowledgeQuantum.objects.all()
     resource_name = 'kq'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "unit": ('exact'),
     }
コード例 #4
0
 class Meta:
     queryset = Unit.objects.all()
     resource_name = 'unit'
     authentication = DjangoAuthentication()
     authorization = PublicReadTeachersModifyAuthorization()
     always_return_data = True
     filtering = {
         "course": ('exact'),
     }
コード例 #5
0
 class Meta:
     queryset = Asset.objects.all()
     resource_name = 'asset'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "available_in": ('exact'),
     }
コード例 #6
0
 class Meta:
     queryset = Option.objects.all()
     resource_name = 'option'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "question": ('exact'),
     }
コード例 #7
0
ファイル: resources.py プロジェクト: CulturePlex/moocng
 class Meta:
     queryset = Attachment.objects.all()
     resource_name = 'attachment'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "kq": ('exact'),
     }
コード例 #8
0
 class Meta:
     queryset = EvaluationCriterion.objects.all()
     resource_name = 'evaluation_criterion'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "assignment": ('exact'),
         "unit": ('exact'),
     }
コード例 #9
0
 class Meta:
     queryset = PeerReviewAssignment.objects.all()
     resource_name = 'peer_review_assignment'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "kq": ('exact'),
         "unit": ('exact'),
     }
コード例 #10
0
 class Meta:
     queryset = AssetAvailability.objects.all()
     resource_name = 'asset_availability'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     filtering = {
         "kq": ('exact'),
         "assets": ('exact'),
     }
コード例 #11
0
ファイル: resources.py プロジェクト: CulturePlex/moocng
 class Meta:
     resource_name = 'activity'
     collection = 'activity'
     datakey = 'courses'
     object_class = MongoObj
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     allowed_methods = ['get', 'put']
     filtering = {
         "unit": ('exact'),
     }
コード例 #12
0
ファイル: resources.py プロジェクト: CulturePlex/moocng
 class Meta:
     resource_name = 'answer'
     collection = 'answers'
     datakey = 'questions'
     object_class = MongoObj
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     allowed_methods = ['get', 'post', 'put']
     filtering = {
         "question": ('exact'),
     }
コード例 #13
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'),
     }
コード例 #14
0
 class Meta:
     resource_name = 'peer_review_submissions'
     collection = 'peer_review_submissions'
     datakey = 'peer_review_submissions'
     object_class = MongoObj
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     validation = PeerReviewSubmissionsResourceValidation()
     allowed_methods = ['get', 'post']
     filtering = {
         "kq": ('exact'),
         "unit": ('exact'),
         "course": ('exact'),
     }
コード例 #15
0
 class Meta:
     resource_name = 'activity'
     collection = 'activity'
     datakey = 'kq_id'
     object_class = MongoObj
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     allowed_methods = ['get', 'post']
     filtering = {
         "course_id": ('exact'),
         "unit_id": ('exact'),
         "kq_id": ('exact'),
     }
     input_schema = {"course_id": 1, "unit_id": 1, "kq_id": 1, "user_id": 1}
コード例 #16
0
 class Meta:
     resource_name = 'peer_review_reviews'
     collection = 'peer_review_reviews'
     datakey = 'peer_review_reviews'
     object_class = MongoObj
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     allowed_methods = ['get']
     filtering = {
         "reviewer": ('exact'),
         "kq": ('exact'),
         "unit": ('exact'),
         "course": ('exact'),
         "submission_id": ('exact'),
     }
コード例 #17
0
 class Meta:
     resource_name = 'answer'
     collection = 'answers'
     datakey = 'question_id'
     object_class = MongoObj
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()
     allowed_methods = ['get', 'post', 'put']
     filtering = {
         "question_id": ('exact'),
         "course_id": ('exact'),
         "unit_id": ('exact'),
         "kq_id": ('exact'),
     }
     validation = AnswerValidation()
     input_schema = {
         "course_id": 1,
         "unit_id": 1,
         "kq_id": 1,
         "question_id": 1,
         "replyList": 1,
         "user_id": 0,
         "date": 0,
     }
コード例 #18
0
ファイル: resources.py プロジェクト: CulturePlex/moocng
 class Meta:
     queryset = Course.objects.all()
     resource_name = 'course'
     allowed_methods = ['get']
     authentication = DjangoAuthentication()
     authorization = DjangoAuthorization()