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