예제 #1
0
 class Meta(GenericMeta):
     queryset = SocialAccount.objects.all()
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'post', 'put', 'delete']
     resource_name = 'SocialAccount'
     authentication = Authentication()
     authorization = Authorization()
예제 #2
0
 class Meta:
     queryset = OpeniPhoto.objects.select_related("context").all()
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'post', 'put', 'delete']
     resource_name = 'photo'
     authentication = Authentication()
     authorization = Authorization()
예제 #3
0
 class Meta:
     queryset = OpeniVideo.objects.all()
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'post', 'put', 'delete']
     resource_name = 'video'
     authentication = Authentication()
     authorization = Authorization()
예제 #4
0
 class Meta(GenericMeta):
     queryset = OpeniGroup.objects.all()
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'post', 'put', 'delete']
     resource_name = 'Group'
     authentication = Authentication()
     authorization = Authorization()
class GenericMeta:
    always_return_data = True
    list_allowed_methods = ['get', 'post', 'put', 'delete']
    detail_allowed_methods = ['get', 'post', 'put', 'delete']
    authentication = Authentication()
    authorization = Authorization()
    # excludes = ['id']
    include_resource_uri = False
예제 #6
0
파일: Resources.py 프로젝트: mpetyx/open-I
    class Meta:
        queryset = OpeniCheckin.objects.all()
        list_allowed_methods = ['get', 'post']
        detail_allowed_methods = ['get', 'post', 'put', 'delete']
        resource_name = 'checkin'
        authentication = Authentication()
        authorization = Authorization()
        # filtering = {
        #     'slug': ALL,
        #     'user': ALL_WITH_RELATIONS,
        #     'created': ['exact', 'range', 'gt', 'gte', 'lt', 'lte'],
        # }


        extra_actions = [

            {
                "name": "comments",
                "http_method": "GET",
                "resource_type": "list",
                "description": "comments from CBS",
                "fields": {
                    "cbs": {
                        "type": "string",
                        "required": True,
                        "description": "list of selected CBS"
                    }
                }
            },

            {
                "name": "likes",
                "http_method": "GET",
                "resource_type": "list",
                "description": "likes from CBS",
                "fields": {
                    "cbs": {
                        "type": "string",
                        "required": True,
                        "description": "list of selected CBS"
                    }
                }
            },

            {
                "name": "dislikes",
                "http_method": "GET",
                "resource_type": "list",
                "description": "dislikes from CBS",
                "fields": {
                    "cbs": {
                        "type": "string",
                        "required": True,
                        "description": "list of selected CBS"
                    }
                }
            }
        ]
예제 #7
0
파일: Resources.py 프로젝트: mpetyx/open-I
 class Meta:
     queryset = SocialApp.objects.all()
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'post', 'put', 'delete']
     resource_name = 'cbsconnector'
     authentication = Authentication()
     authorization = Authorization()
     # filtering = {
     #     'slug': ALL,
     #     'user': ALL_WITH_RELATIONS,
     #     'created': ['exact', 'range', 'gt', 'gte', 'lt', 'lte'],
     # }
예제 #8
0
class GenericMeta:
    list_allowed_methods = ['get', 'post']
    detail_allowed_methods = ['get', 'post', 'put', 'delete']
    authentication = Authentication()
    authorization = Authorization()
    # filtering = {
    #     'slug': ALL,
    #     'user': ALL_WITH_RELATIONS,
    #     'created': ['exact', 'range', 'gt', 'gte', 'lt', 'lte'],
    # }

    extra_actions = [{
        "name": "generic",
        "http_method": "GET",
        "resource_type": "list",
        "description": "Apply Method",
        "fields": {
            "user": {
                "type": "string",
                "required": True,
                "description": "The user required for this action"
            },
            "apps": {
                "type":
                "string",
                "required":
                True,
                "description":
                "The CBS along with the App we want to do a request to"
            },
            "method": {
                "type": "string",
                "required": True,
                "description": "Method needed"
            },
            "data": {
                "type": "string",
                "required": True,
                "description": "The required data"
            },
        }
    }, {
        "name": "comments",
        "http_method": "GET",
        "resource_type": "list",
        "description": "comments from CBS",
        "fields": {
            "cbs": {
                "type": "string",
                "required": True,
                "description": "list of selected CBS"
            }
        }
    }, {
        "name": "likes",
        "http_method": "GET",
        "resource_type": "list",
        "description": "likes from CBS",
        "fields": {
            "cbs": {
                "type": "string",
                "required": True,
                "description": "list of selected CBS"
            }
        }
    }, {
        "name": "dislikes",
        "http_method": "GET",
        "resource_type": "list",
        "description": "dislikes from CBS",
        "fields": {
            "cbs": {
                "type": "string",
                "required": True,
                "description": "list of selected CBS"
            }
        }
    }]
예제 #9
0
 class Meta(GenericMeta):
     queryset = SocialToken.objects.all()
     resource_name = 'SocialToken'
     authentication = Authentication()
     authorization = Authorization()
     serialiser = Serializer(formats=['json'])