From 1d4b638b59ed1d43f2ce47734dd31c658ec6f2e6 Mon Sep 17 00:00:00 2001 From: Andrey Kostakov Date: Thu, 12 Nov 2015 17:05:46 +0300 Subject: [PATCH] maybe solve issue #100 --- tastypie_swagger/mapping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tastypie_swagger/mapping.py b/tastypie_swagger/mapping.py index d85748e..66ddd26 100644 --- a/tastypie_swagger/mapping.py +++ b/tastypie_swagger/mapping.py @@ -201,7 +201,7 @@ def build_parameters_from_filters(self, prefix="", method='GET'): if field == ALL: has_related_resource = False else: - has_related_resource = hasattr(self.resource.fields[name], 'get_related_resource') + has_related_resource = hasattr(self.resource.fields.get(name), 'get_related_resource') if not has_related_resource: #This code has been mostly sucked from the tastypie lib