The $FIELDNAME field does not allow filtering.

601 views
Skip to first unread message

Mohammed Khan

unread,
Apr 17, 2012, 11:15:59 PM4/17/12
to django-...@googlegroups.com
Hi there,

I am using Django 1.3 + Tastypie 0.9.11 , and I have this situation, irrespective to what ModelResource i had filtering options, they just dont seem to work. All i get is this error "The $FieldName field does nto allow filtering.".

For Example:

class UserProfileResource(ModelResource):
user = fields.ForeignKey(UserResource, 'user')
class Meta:
queryset = UserProfile.objects.all()
resource_name = 'uprofile'
#authentication = ApiKeyAuthentication()
authorization= DjangoAuthorization()
paginator_class = Paginator
list_allowed_methods = ['get', 'post']
        detail_allowed_methods = ['get', 'post', 'put', 'delete']
        serializer = Serializer(formats=['json'])
        filtering = {
        "gender": ('exact',),
        }


For this i get the following error: The 'gender' field does not allow filtering.

Any help on how to resolve would be great. 

Thanks.

D X

unread,
Apr 18, 2012, 1:16:02 PM4/18/12
to django-...@googlegroups.com
There's no "gender" field to filter on.  I'm assuming you want something like this, but you'll have to make sure the UserResource is set up to allow filtering on gender.

Mohammed Khan

unread,
Apr 18, 2012, 8:45:42 PM4/18/12
to django-...@googlegroups.com
Well I have got Gender defined as a model field in the UserProfile model. I am not sure what you meant. Thanks.
--
Regards

Mohammed Zakiullah Khan

D X

unread,
Apr 19, 2012, 1:47:39 PM4/19/12
to django-...@googlegroups.com
Hm, looks like google groups did something weird with that url.  Let me try again:


Reply all
Reply to author
Forward
0 new messages