api - Django - Tastypie - How can I get query string parameters in my ModelResource Meta class? -


i have django application writing api using tastypie. have endpoint created calls code:

class collectionmodelresource(modelresource):     """api retireve objincollection specific collection     """      class meta:         allowed_methods = ['get', 'put']         authentication = apikeyauthentication()         authorization = authorization()         queryset = objincollection.objects.filter(collection__collection='mycollection1')         resource_name = 'objects' 

this works return database records collection='mycollection1'. however, pass mycollection1 value in via querystring of request. yet can't seem find exposed request object within meta class.

is there way request object meta class inside modelresource of tastypie???

tastypie not allow this, can solve problem in way. should create custom build_filters() method allows filter queryset before processing request see [docs][1].


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -