From 6fd0c91fd1bbc6ae1a8fae46503464ab63603d38 Mon Sep 17 00:00:00 2001 From: Krzysztof Klimonda Date: Mon, 16 Jul 2012 17:12:59 +0200 Subject: [PATCH] Enable filtering over the published field Tastypie requires that we define a list of fields that can be used for filtering; add the "published" to this list so we can query pinry for the list of images created after some date. --- pinry/api/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pinry/api/api.py b/pinry/api/api.py index c0bd453..fa7cc80 100644 --- a/pinry/api/api.py +++ b/pinry/api/api.py @@ -15,6 +15,9 @@ class PinResource(ModelResource): # pylint: disable-msg=R0904 queryset = Pin.objects.all() resource_name = 'pin' include_resource_uri = False + filtering = { + 'published': ['gt'], + } def dehydrate_thumbnail(self, bundle): pin = Pin.objects.only('image').get(pk=bundle.data['id'])