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'], }
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, }
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']
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']
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()
class Meta: """ The basics for a tastypie resource """ resource_name = 'config' object_class = ConfigObject serializer = CustomSerializer() allowed_methods = ('get') authentication = Authentication() authorization = Authorization()
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'), }
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()
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
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())
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'], }
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()
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']
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()
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']
class Meta: queryset = Section.objects.all() resource_name = 'section' excludes = [] allowed_methods = ['get'] authentication = Authentication() authorization = ReadOnlyAuthorization() filtering = { 'title': ALL, 'parent': ALL, }
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()
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, }
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()
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, }
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()
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()
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
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, }
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'
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, }
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, }
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()
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()
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 = []