Example #1
0
 class Meta:
     always_return_data = True
     queryset = ContainerTemplate.objects.all()
     resource_name = 'containertemplates'
     list_allowed_methods = ['get']
     authentication = Authentication()
     authorization = LoggedInAuthorization()
     # Hide the underlying id
     excludes = ['id']
Example #2
0
    class Meta:
        list_allowed_methods = ['put']
        authentication = Authentication()
        authorization = LoggedInAuthorization()

        # Custom meta attributes
        parent_resource = StoryResource
        related_id_name = 'pk'
        related_queryset = None
Example #3
0
 class Meta:
     always_return_data = True
     queryset = StoryRelation.objects.all()
     resource_name = 'related'
     list_allowed_methods = ['get', 'post', 'put']
     authentication = Authentication()
     authorization = LoggedInAuthorization()
     # Hide the underlying id
     excludes = ['id']
Example #4
0
 class Meta:
     always_return_data = True
     queryset = Location.objects.all()
     resource_name = 'locations'
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'delete']
     authentication = Authentication()
     authorization = LoggedInAuthorization()
     detail_uri_name = 'location_id'
     # Hide the underlying id
     excludes = ['id', 'point']
Example #5
0
    class Meta:
        always_return_data = True
        queryset = Asset.objects.select_subclasses()
        resource_name = 'assets'
        allowed_methods = ['get', 'post', 'put']
        authentication = Authentication()
        authorization = LoggedInAuthorization()
        # Hide the underlying id
        excludes = ['id']

        delayed_authorization_methods = ['put_detail']
Example #6
0
    class Meta:
        queryset = Help.objects.all()
        resource_name = 'help'
        list_allowed_methods = ['get', 'post']
        authentication = Authentication()
        authorization = LoggedInAuthorization()
        # Hide the underlying id
        excludes = ['id']
        validation = HelpValidation()

        delayed_authorization_methods = []
Example #7
0
    class Meta:
        queryset = StoryTemplate.objects.all()
        resource_name = 'templates'
        allowed_methods = ['get']
        # Hide the underlying id
        excludes = ['id']
        authentication = Authentication()
        authorization = LoggedInAuthorization()

        # Custom meta attributes
        # Class of the resource under which this is nested
        parent_resource = StoryResource
Example #8
0
    class Meta:
        queryset = SectionAsset.objects.all()
        resource_name = 'sectionassets'
        allowed_methods = ['get', 'post', 'delete']
        authentication = Authentication()
        authorization = LoggedInAuthorization()
        # Hide the underlying id
        excludes = ['id']

        # Custom meta attributes
        parent_resource = StoryResource
        delayed_authorization_methods = ['delete_detail']
Example #9
0
 class Meta:
     always_return_data = True
     queryset = Tag.objects.all()
     resource_name = 'tags'
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'delete']
     authentication = Authentication()
     authorization = LoggedInAuthorization()
     detail_uri_name = 'tag_id'
     # Hide the underlying id
     excludes = ['id']
     filtering = {
         'name': ('exact', 'startswith', 'istartswith'),
     }
Example #10
0
    class Meta:
        always_return_data = True
        queryset = DataSet.objects.select_subclasses()
        resource_name = 'datasets'
        list_allowed_methods = ['get', 'post']
        detail_allowed_methods = ['get', 'delete']
        authentication = Authentication()
        authorization = LoggedInAuthorization()
        validation = DataSetValidation()
        detail_uri_name = 'dataset_id'
        # Hide the underlying id
        excludes = ['id']

        delayed_authorization_methods = ['delete_detail']
Example #11
0
    class Meta:
        always_return_data = True
        queryset = Section.objects.all().order_by('weight')
        resource_name = 'sections'
        list_allowed_methods = ['get', 'post']
        detail_allowed_methods = ['get', 'patch', 'put', 'delete']
        authentication = Authentication()
        authorization = LoggedInAuthorization()
        # Hide the underlying id
        excludes = ['id']
        filtering = {
            'story': ALL_WITH_RELATIONS,
        }

        # Custom meta attributes
        # Class of the resource under which this is nested
        parent_resource = StoryResource
Example #12
0
    class Meta:
        always_return_data = True
        queryset = Story.objects.all()
        resource_name = 'stories'
        allowed_methods = ['get', 'post', 'patch', 'put']
        authentication = Authentication()
        authorization = LoggedInAuthorization()
        # Hide the underlying id
        excludes = ['id']
        filtering = {
            'story_id': ALL,
        }

        # Custom meta attributes
        # Methods that handle authorization later than normain in the flow
        delayed_authorization_methods = ('patch_detail', 'put_detail')
        # Filter arguments for custom explore endpoint
        explore_filter_fields = [
            'topics', 'projects', 'organizations', 'languages', 'places'
        ]
        explore_point_field = 'points'