You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some problem in using DjangoAuthorization , when I use this in my resource I get this error:
{"error_message": "'QuerySet' object has no attribute 'model'", "traceback": "Traceback (most recent call last):\n\n File "/usr/local/lib/python2.7/dist-packages/tastypie/resources.py", line 201, in wrapper\n response =
callback(request, _args, *_kwargs)\n\n File "/usr/local/lib/python2.7/dist-packages/tastypie/resources.py", line 432, in dispatch_list\n return self.dispatch('list', request, *_kwargs)\n\n File "/usr/local/lib/python2.7/dist-
packages/tastypie_mongoengine/resources.py", line 374, in dispatch\n return super(MongoEngineResource, self).dispatch(request_type, request, *_kwargs)\n\n File "/usr/local/lib/python2.7/dist-packages/tastypie/resources.py", line
464, in dispatch\n response = method(request, *_kwargs)\n\n File "/usr/local/lib/python2.7/dist-packages/tastypie/resources.py", line 1286, in get_list\n objects = self.obj_get_list(bundle=base_bundle,
*_self.remove_api_resource_names(kwargs))\n\n File "/usr/local/lib/python2.7/dist-packages/tastypie/resources.py", line 2068, in obj_get_list\n return self.authorized_read_list(objects, bundle)\n\n File
"/usr/local/lib/python2.7/dist-packages/tastypie/resources.py", line 583, in authorized_read_list\n auth_result = self._meta.authorization.read_list(object_list, bundle)\n\n File "/usr/local/lib/python2.7/dist-
packages/tastypie/authorization.py", line 152, in read_list\n klass = self.base_checks(bundle.request, object_list.model)\n\nAttributeError: 'QuerySet' object has no attribute 'model'\n"}
but without using this It works fine, am I missed some thing? my resource is:
'''
class MainUserResource(resources.MongoEngineResource):
enduser = fields.ToOneField('interface.api.EndUserResource', 'enduser', full=False, null=True, blank=True)
yes you must write your own authorization but another problem is default django permission in mongoengin does not work properly, I found the problem and solved It, you can see It in this link: MongoEngine/mongoengine#898
I have some problem in using DjangoAuthorization , when I use this in my resource I get this error:
but without using this It works fine, am I missed some thing? my resource is:
'''
class MainUserResource(resources.MongoEngineResource):
enduser = fields.ToOneField('interface.api.EndUserResource', 'enduser', full=False, null=True, blank=True)
The text was updated successfully, but these errors were encountered: