check for presence of _geo_indices on field class before referencing

This commit is contained in:
Gareth Lloyd 2011-08-15 10:01:48 +01:00
parent 048826f6f0
commit 4abfcb0188

View File

@ -812,7 +812,8 @@ class BaseDocument(object):
field_cls = field.document_type
if field_cls in inspected_classes:
continue
geo_indices += field_cls._geo_indices(inspected_classes)
if hasattr(field_cls, '_geo_indices'):
geo_indices += field_cls._geo_indices(inspected_classes)
elif field._geo_index:
geo_indices.append(field)
return geo_indices