Ejemplo n.º 1
0
 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
     }
Ejemplo n.º 2
0
 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()
Ejemplo n.º 3
0
 class Meta:
     cache = HttpCache(control={'max_age': 3600, 'public': True,
                                's-maxage': 3600})
     queryset = User.objects.filter(userprofile__registration_complete=True,
                                    groups__name='Rep')
     resource_name = 'rep'
     authentication = Authentication()
     authorization = ReadOnlyAuthorization()
     serializer = CSVSerializer(formats=['json', 'jsonp', 'csv'])
     allowed_methods = ['get']
     fields = ['first_name', 'last_name']
     ordering = ['profile', 'first_name', 'last_name']
     filtering = {'first_name': ALL,
                  'last_name': ALL,
                  'profile': ALL_WITH_RELATIONS}