You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
wdifruscio
changed the title
id as UUID causing me a headache
id as UUID is causing me errors
Feb 18, 2025
wdifruscio
changed the title
id as UUID is causing me errors
id as UUID is causing errors
Feb 18, 2025
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
Model
The text was updated successfully, but these errors were encountered: