nonrel(Mongodb) with tastypie.I have created one resource class which return selected auth_user from the database.Because of some reasons I did change _id field type from ObjectId to Int64.I used raw_query() for accessing desired auth_user but it doesn't seems to work.Can anyone suggest me what should I do to make raw_query() work for UserModel.
Here is my tastypie resource:
class UserResource(ModelResource):
class Meta:
queryset=User.objects.raw_query({'_id':5})
resource_name="user"
fields=["username","first_name","last_name"]
include_resource_uri=False
allowed_methods=["get"]
output:
'UserManager' object has no attribute 'raw_query'
This is not related to Tastypie at all. Are you sure you need a raw query, or is the above just an example?
By looking at the docs you should be able to do the following:
Then you should be able to use it as you do above, i.e: