コード例 #1
0
ファイル: resources.py プロジェクト: alexmgarcia/magiconf
 class Meta:
     resource_name = 'device'
     allowed_methods = ['post']
     authentication = CustomAuthentication()
     authorization = Authorization()
     serializer = Serializer(formats=['json'])
     form_class = DeviceForm
コード例 #2
0
 class Meta:
     include_resource_uri = False
     queryset = Sponsor.objects.all()
     authorization = Authorization()
     serializer = PrettyJSONSerializer()
     authentication = CustomAuthentication()
     authorization = DjangoAuthorization()
     list_allowed_methods = ['get']
     """authentication = OAuth20Authentication()"""
コード例 #3
0
 class Meta:
     include_resource_uri = False
     queryset = Sight.objects.select_subclasses()
     authorization = Authorization()
     paginator_class = Paginator
     authentication = CustomAuthentication()
     authorization = DjangoAuthorization()
     list_allowed_methods = ['get']
     """authentication = OAuth20Authentication()"""
コード例 #4
0
 class Meta:
     include_resource_uri = False
     queryset = Contact.objects.all()
     paginator_class = Paginator
     serializer = PrettyJSONSerializer()
     authentication = CustomAuthentication()
     authorization = DjangoAuthorization()
     list_allowed_methods = ['get', 'post']
     resource_name = 'contact'
     """authentication = OAuth20Authentication()"""
コード例 #5
0
 class Meta:
     include_resource_uri = False
     queryset = Notification.objects.all()
     authorization = Authorization()
     serializer = PrettyJSONSerializer()
     authentication = CustomAuthentication()
     authorization = DjangoAuthorization()
     list_allowed_methods = ['get']
     """authentication = OAuth20Authentication()"""
     filtering = {
         'title': ALL,
         'date': ('exact', 'startswith', 'gt'),
     }
コード例 #6
0
    class Meta:
        include_resource_uri = False
        queryset = Conference.objects.all()
        authorization = Authorization()
        serializer = PrettyJSONSerializer()
        authentication = CustomAuthentication()
        #authorization = DjangoAuthorization()
        list_allowed_methods = ['get']
        """authentication = OAuth20Authentication()"""

        filtering = {
            'name': ALL,
        }
コード例 #7
0
    class Meta:
        include_resource_uri = False
        queryset = Hotel.objects.all()
        authorization = Authorization()
        paginator_class = Paginator
        authentication = CustomAuthentication()
        authorization = DjangoAuthorization()
        list_allowed_methods = ['get']
        """authentication = OAuth20Authentication()"""

        filtering = {
            'name': ALL,
        }
コード例 #8
0
    class Meta:
        include_resource_uri = False
        queryset = Poster.objects.all()
        authorization = Authorization()
        serializer = PrettyJSONSerializer()
        authentication = CustomAuthentication()
        authorization = DjangoAuthorization()
        list_allowed_methods = ['get']
        """authentication = OAuth20Authentication()"""

        paginator_class = Paginator
        filtering = {
            'title': ALL,
        }
コード例 #9
0
    class Meta:
        include_resource_uri = False
        queryset = KeynoteSpeaker.objects.all()
        authorization = Authorization()
        paginator_class = Paginator
        serializer = PrettyJSONSerializer()
        authentication = CustomAuthentication()
        authorization = DjangoAuthorization()
        list_allowed_methods = ['get']
        """authentication = OAuth20Authentication()"""

        filtering = {
            'name': ALL,
            'email': ALL,
        }
コード例 #10
0
 class Meta:
     include_resource_uri = False
     queryset = Participant.objects.all()
     authorization = Authorization()
     paginator_class = Paginator
     serializer = PrettyJSONSerializer()
     authentication = CustomAuthentication()
     authorization = DjangoAuthorization()
     list_allowed_methods = ['get']
     """authentication = OAuth20Authentication()"""
     resource_name = 'participant_full'
     filtering = {
         'name': ALL,
         'username': ALL,
     }
コード例 #11
0
 class Meta:
     include_resource_uri = False
     queryset = Participant.objects.all()
     authorization = Authorization()
     paginator_class = Paginator
     serializer = PrettyJSONSerializer()
     authentication = CustomAuthentication()
     authorization = DjangoAuthorization()
     excludes = ['qrcode']
     list_allowed_methods = ['get']
     """authentication = OAuth20Authentication()"""
     filtering = {
         'name': ALL,
         'username': ALL,
         'last_modified_date': ['gt']
     }
コード例 #12
0
 class Meta:
     include_resource_uri = False
     queryset = PosterSession.objects.all()
     authorization = Authorization()
     paginator_class = Paginator
     serializer = PrettyJSONSerializer()
     authentication = CustomAuthentication()
     authorization = DjangoAuthorization()
     list_allowed_methods = ['get']
     """authentication = OAuth20Authentication()"""
     filtering = {
         'title': ALL,
         'time': (
             'exact',
             'startswith',
         ),
         'last_modified_date': ['gt']
     }
コード例 #13
0
def validade_user(request, username, password):
    authorizer = CustomAuthentication()
    if authorizer.validate_user(request,username,password):
        return HttpResponse('OK', status=200)
    else:
        return HttpResponse('Unauthorized', status=401)
コード例 #14
0
 class Meta:
     resource_name = 'pin'
     allowed_methods = ['post']
     authentication = CustomAuthentication()
     authorization = Authorization()
     serializer = PrettyJSONSerializer()