Skip to content

Commit dd4f0eb

Browse files
author
Quinn Chaffee
authored
Add @Property ObjectId support
This will allow for use of `@property` fields to be used for the `ObjectId`
1 parent cc424e0 commit dd4f0eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

algoliasearch_django/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __init__(self, model, client, settings):
125125
self.fields)))
126126

127127
# Check custom_objectID
128-
if self.custom_objectID in chain(['pk'], all_model_fields):
128+
if self.custom_objectID in chain(['pk'], all_model_fields) or hasattr(self, self.custom_objectID):
129129
self.objectID = get_model_attr(self.custom_objectID)
130130
else:
131131
raise AlgoliaIndexError('{} is not a model field of {}'.format(

0 commit comments

Comments
 (0)