Beispiel #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()
Beispiel #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()
Beispiel #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()
 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
Beispiel #6
0
    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"
                    }
                }
            }
        ]
Beispiel #7
0
 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'],
     # }
Beispiel #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"
            }
        }
    }]
Beispiel #9
0
 class Meta(GenericMeta):
     queryset = SocialToken.objects.all()
     resource_name = 'SocialToken'
     authentication = Authentication()
     authorization = Authorization()
     serialiser = Serializer(formats=['json'])