Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Support for django.db.models.TimeField #419

Closed
Saman-Zand-H opened this issue Aug 12, 2022 · 0 comments · Fixed by #426
Closed

No Support for django.db.models.TimeField #419

Saman-Zand-H opened this issue Aug 12, 2022 · 0 comments · Fixed by #426

Comments

@Saman-Zand-H
Copy link

the code in elasticsearch-py says that the types it translates into isoformat, which is then supported by elasticsearch itself, are datetime.date and datetime.datetime; i.e. no support for datetime.time. And django-elasticsearch-dsl doesn't use the isoformat either. I have a TimeField that needs to be indexed. When I execute search_index --populate it throws an exception "elasticsearch.exceptions.SerializationError: ({'item_reviews': [], 'restaurant': {'name': 'test', 'delivery_price': Decimal('0.00'), 'opens_at': datetime.time(6, 0), 'closes_at': datetime.time(11, 11, 34)}, 'name': 'burger', 'price': Decimal('23.500')}, TypeError("Unable to serialize datetime.time(6, 0) (type: <class 'datetime.time'>)"))
". What should I do?

safwanrahman added a commit to safwanrahman/django-elasticsearch-dsl that referenced this issue Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant