-
Notifications
You must be signed in to change notification settings - Fork 62
Open
Description
I do not use integer pks - its a very old project with uuid4s
I get a to_dict() error when defaulting to the id.
custom_objectID = 'field' would work, if I could just return str(instance.id) but I can't find a way to do this. Maybe I missed something.
For now, I am either going to have to create a custom_id property on each model..
My Error
File "/usr/local/lib/python3.12/site-packages/algoliasearch/http/serializer.py", line 64, in body_serializer
obj_dict = obj.to_dict()
^^^^^^^^^^^
AttributeError: 'UUID' object has no attribute 'to_dict'
Model
import uuid
class UUIDModel(models.Model):
id = models.UUIDField(primary_key=True, editable=False, default=uuid.uuid4)
class Meta:
abstract = True
Metadata
Metadata
Assignees
Labels
No labels