Skip to content

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

Closed
@Saman-Zand-H

Description

@Saman-Zand-H

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions