Beispiel #1
0
 class Meta:
     queryset = Channel.objects.order_by('name').all()
     list_allowed_methods = ['get', ]
     detail_allowed_methods = ['get', ]
     resource_name = 'abcast/channel'
     excludes = ['on_air_id', ]
     authentication = Authentication()
     authorization = Authorization()
     filtering = {
         'created': ['exact', 'range', 'gt', 'gte', 'lt', 'lte'],
     }
Beispiel #2
0
	class Meta:
		queryset = ExerciseSession.objects.all()
		resource_name = 'exercise_session'
		authentication = Authentication()
		authorization = Authorization()
		allowed_methods = ['get', 'put', 'patch', 'post']
		excludes = ['resource_uri', 'user', 'meta']
		filtering = {
			'user': ALL_WITH_RELATIONS,
			'id': ALL_WITH_RELATIONS,
		}
Beispiel #3
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']
Beispiel #4
0
 class Meta(GenericMeta):
     queryset = File.objects.all()
     resource_name = 'file'
     filtering = {'project_part': ALL}
     authorization = ProjectPartElemAuthorization()
     authentication = MultiAuthentication(OAuth20Authentication(),
                                          SessionAuthentication(),
                                          Authentication())
     serializer = DatetimeSerializer()
     ordering = ['-original_name']
     allowed_methods = ['GET', 'DELETE']
Beispiel #5
0
 class Meta:
     queryset = MobilisingInterest.active_objects.all()
     resource_name = 'mobilisinginterests'
     authentication = Authentication()
     authorization = ReadOnlyAuthorization()
     include_resource_uri = False
     include_absolute_url = False
     allowed_methods = ['get']
     fields = ['name']
     filtering = {'name': ALL}
     throttle = RemoAPIThrottle()
Beispiel #6
0
    class Meta:
        """
        The basics for a tastypie resource
        """
        resource_name = 'config'
        object_class = ConfigObject
        serializer = CustomSerializer()
        allowed_methods = ('get')

        authentication = Authentication()
        authorization = Authorization()
Beispiel #7
0
 class Meta:
     queryset = Collection.objects.all()
     authentication = Authentication()
     authorization = ReadOnlyAuthorization()
     serializer = Serializer(
         formats=['json', 'jsonp', 'xml', 'yaml', 'plist'])
     filtering = {
         "url_harvest": ('exact', 'startswith'),
         "slug": ALL,
         "harvest_type": ('exact'),
     }
Beispiel #8
0
    class Meta:
        queryset = Category.objects.all()
        include_resource_uri = False
        list_allowed_methods = ['get']
        resource_name = 'categories'
        collection_name = 'categories'
        limit = 100
        excludes = []

        authentication = Authentication()
        authorization = Authorization()
Beispiel #9
0
 class Meta:
     queryset = Log.objects.all()
     resource_name = 'log'
     authentication = Authentication()
     authorization = Authorization()
     # todo: authentication = MultiAuthentication(ProviderAuthentication(), HBPAuthentication())
     # todo: authorization = CollabAuthorization()
     list_allowed_methods = ['post']
     # you can retrieve and modify each item
     detail_allowed_methods = ['get', 'put', 'patch', 'delete']
     always_return_data = False
Beispiel #10
0
 class Meta:
     Channel = apps.get_model('tv', 'Channel')
     queryset = Channel.objects.filter(enabled=True, source__isnull=False)
     # excludes = ['enabled', 'description', 'enabled', 'name']
     fields = ['id', 'channelid', 'number', 'buffer_size']
     allowed_methods = ['get']
     resource_name = 'userchannel'
     authorization = MyChannelResourceAuthorization()
     authentication = MultiAuthentication(
         BasicAuthentication(realm='cianet-middleware'),
         SessionAuthentication(), Authentication(), ApiKeyAuthentication())
Beispiel #11
0
 class Meta:
     queryset = Follow.objects.all()
     allowed_methods = ['get']
     authorization = ReadOnlyAuthorization()
     authentication = MultiAuthentication(ExpireApiKeyAuthentication(),
                                          Authentication())
     resource_name = "follow"
     object_name = "follow"
     filtering = {
         'object_id': ['exact'],
     }
Beispiel #12
0
 class Meta:
     queryset = EventMetricOutcome.objects.all()
     resource_name = 'event_metrics_outcome'
     authentication = Authentication()
     authorization = ReadOnlyAuthorization()
     include_resource_uri = False
     include_absolute_url = False
     allowed_methods = ['get']
     fields = ['metric', 'expected_outcome', 'outcome']
     max_limit = 40
     throttle = RemoAPIThrottle()
Beispiel #13
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']
Beispiel #14
0
 class Meta:
     queryset = Open.objects.all()
     resource_name = 'open'
     filtering = {
         "name": ALL,
         "user": ALL_WITH_RELATIONS,
     }
     allowed_methods = ['get', 'post', 'put', 'delete']
     serializer = urlencodeSerializer()
     authentication = Authentication()
     authorization = Authorization()
Beispiel #15
0
 class Meta:
     resource_name = 'comments'
     queryset = api.models.Comment.objects.all()
     authentication = Authentication()
     authorization = Authorization()
     #cache = SimpleCache()
     filtering = {
         'report': ALL,
         'user': ALL_WITH_RELATIONS,
     }
     ordering = ['creationTime', 'newStatus', 'user', 'report', 'id']
Beispiel #16
0
 class Meta:
     queryset = Section.objects.all()
     resource_name = 'section'
     excludes = []
     allowed_methods = ['get']
     authentication = Authentication()
     authorization = ReadOnlyAuthorization()
     filtering = {
         'title': ALL,
         'parent': ALL,
     }
Beispiel #17
0
 class Meta:
     object_class = User
     queryset = User.objects.all()
     fields = ['username', 'first_name', 'last_name', 'email']
     allowed_methods = ['post']
     resource_name = 'user'
     include_resource_uri = False
     authentication = Authentication()
     always_return_data = True
     excludes = ['email', 'password', 'is_superuser']
     authorization = Authorization()
Beispiel #18
0
 class Meta:
     queryset = Speech.objects.filter(public=True)
     resource_name = 'speech'
     excludes = ['celery_task_id', 'public']
     allowed_methods = ['get', 'post']
     authentication = Authentication()
     authorization = ReadOnlyAuthorization()
     filtering = {
         'speaker': ALL_WITH_RELATIONS,
         'start_date': ALL,
     }
Beispiel #19
0
	class Meta:
		always_return_data = True
		limit = 0
		today_min = datetime.date.today() + datetime.timedelta(days = 2)
		today_minm = datetime.datetime.now() - datetime.timedelta(days = 31)
		today_mind = datetime.date.today().strftime("%d")
		queryset = WaiterTask.objects.filter(reservation__isnull=False, state = 0)
		resource_name = 'reservations'
		allowed_methods = ['get',]
		authentication = Authentication()
		authorization = Authorization()
Beispiel #20
0
 class Meta:
     queryset = BankInfo.objects.all()
     resource_name = 'bank_info'
     list_allowed_methods = ['get', 'post', 'patch', 'put', 'delete']
     authorization = Authorization()
     include_resource_uri = True
     always_return_data = True
     authentication = Authentication()
     filtering = {
         'id': ALL,
     }
Beispiel #21
0
 class Meta(GenericMeta):
     queryset = Post.objects.all()
     resource_name = 'post'
     filtering = {'project_part': ALL}
     authorization = ProjectPartElemAuthorization()
     authentication = MultiAuthentication(OAuth20Authentication(),
                                          SessionAuthentication(),
                                          Authentication())
     #ordering = ['created']
     serializer = DatetimeSerializer()
     validation = PostValidation()
Beispiel #22
0
 class Meta:
     list_allowed_methods = ['get', 'post']
     detail_allowed_methods = ['get', 'post', 'put', 'delete']
     queryset = Item.objects.all()
     resource_name = 'items'
     fields = ['source', 'target', 'topic', 'category', 'id']
     excludes = ['resource_uri']
     filtering = {'topic': ALL}
     serializer = Serializer(formats=['json', 'jsonp'])
     authentication = Authentication()
     authorization = Authorization()
Beispiel #23
0
 class Meta:
     queryset = Course.objects.filter(CourseFilter.IS_NOT_DRAFT
                                      & CourseFilter.IS_NOT_ARCHIVED)
     resource_name = 'coursestructure'
     allowed_methods = ['get']
     fields = ['shortname', 'id', 'structure']
     authentication = Authentication()
     authorization = Authorization()
     serializer = CourseJSONSerializer()
     always_return_data = True
     include_resource_uri = True
Beispiel #24
0
 class Meta:
     queryset = Tasks.objects.all()
     resource_name = 'items'
     allowed_methods = ['get', 'post', 'put', 'delete']
     always_return_data = True
     authentication = Authentication()
     authorization = Authorization()
     filtering = {
         'owner': ALL_WITH_RELATIONS,
         'assigned_to': ALL_WITH_RELATIONS,
     }
Beispiel #25
0
	class Meta:
		authentication = Authentication()
		authorization = Authorization()
		# Because this can be updated nested under the UserProfile, it needed
		# 'put'. No idea why, since patch is supposed to be able to handle
		# partial updates.
		allowed_methods = ['get', 'patch', 'put', 'post', 'get']
		always_return_data = True
		queryset = User.objects.all()
		excludes = ['is_active', 'is_staff', 'is_superuser', 'date_joined', 'last_login']
		resource_name = 'user'
Beispiel #26
0
 class Meta:
     queryset = Teammates.objects.all()
     resource_name = 'teammates'
     allowed_methods = ['get', 'post', 'put', 'delete']
     always_return_data = True
     authentication = Authentication()
     authorization = Authorization()
     filtering = {
         'user': ALL_WITH_RELATIONS,
         'team': ALL_WITH_RELATIONS,
     }
Beispiel #27
0
	class Meta:
		queryset = BodyLocationResponse.objects.all()
		resource_name = 'body_location'
		authentication = Authentication()
		authorization = Authorization()
		always_return_data = True
		allowed_methods = ['get', 'put', 'patch', 'post']
		excludes = ['resource_uri', 'meta']
		filtering = {
			'id': ALL_WITH_RELATIONS,
		}
Beispiel #28
0
    class Meta:
        queryset = User.objects.all()
        include_resource_uri = False
        always_return_data = True
        list_allowed_methods = ['post']
        resource_name = 'register'
        excludes = ['password', 'is_staff', 'is_superuser', 'id']
        validation = FormValidation(form_class=UserForm)

        authentication = Authentication()  # No need for auth, public resource
        authorization = Authorization()
Beispiel #29
0
	class Meta:
		resource_name          = 'comment'
		queryset               = Comment.objects.all()
		list_allowed_methods   = ['get', 'post']
		detail_allowed_methods = ['get', 'post', 'delete']
		filtering = {
			'article': ALL_WITH_RELATIONS,
		}

		authentication = Authentication()
		authorization  = Authorization()
Beispiel #30
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 = []