Cleanup usages of get_field_by_name in search

This commit is contained in:
Karl Hobley 2015-04-02 15:33:53 +01:00
parent 6dfa1aad01
commit 381bd10665
2 changed files with 3 additions and 3 deletions

View file

@ -43,8 +43,8 @@ class DBSearchQuery(BaseSearchQuery):
for field_name in fields:
# Check if the field exists (this will filter out indexed callables)
try:
model._meta.get_field_by_name(field_name)
except:
model._meta.get_field(field_name)
except models.fields.FieldDoesNotExist:
continue
# Filter on this field

View file

@ -88,7 +88,7 @@ class BaseField(object):
self.kwargs = kwargs
def get_field(self, cls):
return cls._meta.get_field_by_name(self.field_name)[0]
return cls._meta.get_field(self.field_name)
def get_attname(self, cls):
try: