class Meta: queryset = EventType.objects.all() resource_name = 'event' allowed_methods = ['get'] filter = {'pk': ALL} authorization = ReadOnlyAuthorization() authentication = BasicAuthentication()
class Meta: cache = HttpCache(control={ 'max_age': 1800, 's_maxage': 1800, 'public': True }) queryset = Event.objects.all() resource_name = 'event' authentication = Authentication() authorization = ReadOnlyAuthorization() serializer = iCalSerializer(formats=['json', 'jsonp', 'ical']) allowed_methods = ['get'] ordering = ['start'] fields = [ 'name', 'start', 'end', 'timezone', 'venue', 'city', 'region', 'country', 'lat', 'lon', 'external_link', 'description', 'mozilla_event', 'owner', 'estimated_attendance' ] filtering = { 'name': ALL, 'city': ALL, 'region': ALL, 'country': ALL, 'start': ALL, 'end': ALL, 'categories': ALL_WITH_RELATIONS }
class Meta: include_resource_uri = False allowed_methods = ['get'] resource_name = 'fare' object_class = DictObject authorization= ReadOnlyAuthorization() authentication= BasicAuthentication()
class Meta: last_id = 0 queryset = Documento.objects.exclude(url_xml=None).order_by('fecha_publicacion') resource_name = 'documento' api_name = 'v1', detail_uri_name = 'identificador' list_allowed_methods = ['get', 'post'] detail_allowed_methods = ['get', 'post'] ordering = ['id'] filtering = { 'titulo': ALL, 'identificador': ALL, 'fecha_publicacion': ALL, 'diario': ALL_WITH_RELATIONS, 'seccion' : ALL, 'materias': ALL_WITH_RELATIONS, 'legislatura': ALL_WITH_RELATIONS, 'notas': ALL_WITH_RELATIONS, 'referencias_anteriores': ALL_WITH_RELATIONS, 'referencias_posteriores': ALL_WITH_RELATIONS, } # authentication = BasicAuthentication() authorization = ReadOnlyAuthorization() paginator_class = EstimatedCountPaginator cache = SimpleCache(timeout=60*60*24)
class Meta: queryset = UserProfile.objects.filter(registration_complete=True) resource_name = 'profile' authentication = Authentication() authorization = ReadOnlyAuthorization() include_resource_uri = False include_absolute_url = False allowed_methods = ['get'] fields = [ 'city', 'region', 'country', 'display_name', 'local_name', 'lon', 'lat', 'mozillians_profile_url', 'twitter_account', 'facebook_url', 'diaspora_url', 'personal_blog_feed', 'irc_name' ] ordering = ['country'] filtering = { 'display_name': ALL, 'local_name': ALL, 'irc_name': ALL, 'country': ALL, 'region': ALL, 'city': ALL, 'functional_areas': ALL_WITH_RELATIONS, 'mobilising_skills': ALL_WITH_RELATIONS, 'mobilising_interests': ALL_WITH_RELATIONS } max_limit = 40 throttle = RemoAPIThrottle()
class Meta: queryset = Tenure.objects.all() resource_name = 'tenure' authorization = ReadOnlyAuthorization() #fields = ['origin_point', 'fire_boundary', 'area', 'fire_position', 'tenure_id'] allowed_methods = ['get'] list_allowed_methods = ['get']
class Meta: queryset = FatalEncounter.objects.filter(proofed=True) list_allowed_methods = [ 'get', ] detail_allowed_methods = [ 'get', ] authorization = ReadOnlyAuthorization() excludes = ['proofed', 'photo_url', 'source_url'] resource_name = 'fatalencounters' max_limit = 10000 filtering = { 'date_of_injury': ['exact', 'lt', 'lte', 'gte', 'gt'], 'state': [ 'exact', ], 'city': [ 'exact', ], 'race': [ 'exact', ], } cache = SimpleCache(timeout=10) serializer = PrettyJSONSerializer()
class Meta: queryset = Persona.objects.all() authorization = ReadOnlyAuthorization() authentication = MultiAuthentication(SessionAuthentication(), Authentication(), ApiKeyAuthentication())
class Meta(GCloudModelResource.CommonMeta): queryset = CeleryTask.objects.all() authorization = ReadOnlyAuthorization() resource_name = "celery_task" filtering = { "enabled": ALL, }
class Meta: queryset = User.objects.all() fields = ['username'] detail_uri_name = 'username' authorization = ReadOnlyAuthorization() authentication = ApiKeyAuthentication()
class Meta: queryset = UserProfile.objects.select_related() authentication = VouchedAuthentication() authorization = ReadOnlyAuthorization() serializer = TimeSerialize() resource_name = 'contact' fields = ['display_name', 'id', 'website', 'ircname', 'last_updated']
class Meta: queryset = BlogProxy.secondary.published().order_by('-publish_date') resource_name = "post" fields = [ 'id', 'title', 'featured_image', 'description', 'publish_date', 'allow_comments', 'comments_count', 'rating_average', 'rating_count', 'modified_date', ] list_allowed_methods = [ 'get', ] detail_allowed_methods = [ 'get', ] throttle = CacheDBThrottle() filtering = { "publish_date": ('gt', ), } serializer = CamelCaseJSONSerializer() authentication = ApiKeyAuthentication() authorization = ReadOnlyAuthorization() limit = 5 paginator_class = RestKitPaginator
class Meta: queryset = User.objects.all() resource_name = 'user' fields = ['id', 'username', 'first_name', 'last_name', 'last_login'] allowed_methods = ['get'] authentication = OAuth20Authentication() authorization = ReadOnlyAuthorization()
class Meta(GCloudModelResource.Meta): queryset = CeleryTask.objects.all() authorization = ReadOnlyAuthorization() resource_name = 'celery_task' filtering = { 'enabled': ALL, }
class Meta: queryset = ItemTemplate.objects.all() authorization = ReadOnlyAuthorization() authentication = MultiAuthentication(SessionAuthentication(), Authentication(), ApiKeyAuthentication())
class Meta: class_object = Auth authentication = AnonymousAuthentication() authorization = ReadOnlyAuthorization() list_allowed_methods = ["get"] detail_allowed_methods = [] resource_name = "auth"
class Meta: cache = HttpCache(control={ 'max_age': 1800, 's_maxage': 1800, 'public': True }) # By default events should be always ordered by start date unless # specified by a query parameter queryset = Event.objects.all().order_by('start') resource_name = 'event' authentication = Authentication() authorization = ReadOnlyAuthorization() serializer = iCalSerializer(formats=['json', 'jsonp', 'ical']) allowed_methods = ['get'] ordering = ['start', 'end'] fields = [ 'name', 'start', 'end', 'timezone', 'venue', 'city', 'region', 'country', 'lat', 'lon', 'external_link', 'description', 'mozilla_event', 'owner', 'estimated_attendance', 'actual_attendance' ] filtering = { 'name': ALL, 'city': ALL, 'region': ALL, 'country': ALL, 'start': ALL, 'end': ALL, 'estimated_attendance': ALL, 'categories': ALL_WITH_RELATIONS, 'campaign': ALL_WITH_RELATIONS } max_limit = 40 throttle = RemoAPIThrottle()
class Meta: authentication = SessionAuthentication() authorization = ReadOnlyAuthorization() allowed_methods = ['get'] paginator_class = NoCountPaginator # @@@ things will break if a user has more than 500 groups or students limit = 500
class Meta: queryset = User.objects.all() resource_name = 'auth/user' #api slug reference fields = ['username', 'first_name', 'last_name', 'last_login'] allowed_methods = ['get'] authentication = BasicAuthentication() authorization = ReadOnlyAuthorization() serializer = Serializer(formats=['json', 'plist'])
class Meta: authentication = DefaultAuthentication() authorization = ReadOnlyAuthorization() always_return_data = True include_resource_uri = False serializer = DefaultSerializer() validation = DefaultValidation() allowed_update_fields = []
class Meta: if settings.API_TEST_MODE: authentication = Authentication() logger.warning('no API authentication active') else: authentication = ApiKeyAuthentication() authorization = ReadOnlyAuthorization() serializer = JSONForHTMLSerializer()
class Meta: authentication = BaseAuthentication() authorization = ReadOnlyAuthorization() queryset = Tag.objects.all() filtering = { 'name': ('exact'), }
class Meta: queryset = ComponentModel.objects.filter(status=True).order_by('name') resource_name = 'component' excludes = ['status', 'id'] detail_uri_name = 'code' ordering = ['name'] authorization = ReadOnlyAuthorization() limit = 0
class Meta(SearchResource.Meta): authorization = ReadOnlyAuthorization() authentication = OptionalOAuthAuthentication() detail_allowed_methods = [] fields = SearchResource.Meta.fields + ['id', 'cat'] list_allowed_methods = ['get'] resource_name = 'search/featured' slug_lookup = None
class Meta(AppResource.Meta): resource_name = 'search' allowed_methods = [] detail_allowed_methods = [] list_allowed_methods = ['get'] authorization = ReadOnlyAuthorization() authentication = OptionalOAuthAuthentication() slug_lookup = None
class Meta: queryset = Genre.objects.all() filtering = { 'name': ALL_WITH_RELATIONS, 'race': ALL_WITH_RELATIONS } resource_name = 'genre' authorization = ReadOnlyAuthorization()
class Meta: queryset = VariableModel.objects.filter(status=True) resource_name = 'variable' excludes = ['status', 'id'] detail_uri_name = 'code' ordering = ['id'] authorization = ReadOnlyAuthorization() limit = 0
class Meta: queryset = Question.objects.all() resource_name = 'question' list_allowed_methods = ['get'] detail_allowed_methods = ['get'] authorization = ReadOnlyAuthorization() authentication = ApiKeyAuthentication()
class Meta: queryset = CourseTag.objects.all() allowed_methods = ['get'] fields = ['id', 'course', 'tag'] include_resource_uri = False authentication = ApiKeyAuthentication() authorization = ReadOnlyAuthorization() always_return_data = True
class Meta: queryset = UserProfile.objects.all() resource_name = 'profile' list_allowed_methods = [] detail_allowed_methods = ['get'] authorization = ReadOnlyAuthorization() authentication = ApiKeyAuthentication()