Open jotelha opened 1 year ago
Originally, sql_models.Dataset(db.Model) defines columns frozen_at and created_at as db.DateTime(), its method as_dict() converts those with dtoolcore.utils.timestamp(self.frozen_at). This, however, results in the autogenerated client API to expect a serialized datetime object and to throw an exception when receiving float. Treat created_at and frozen_at as floats in schema with https://github.com/jotelha/dtool-lookup-server/blob/9d1b8cc751f1d1e143bae10d9454d86be438dc13/dtool_lookup_server/sql_models.py#L122-L128 as suggested below https://marshmallow.readthedocs.io/en/latest/quickstart.html#implicit-field-creation.
sql_models.Dataset(db.Model)
frozen_at
created_at
db.DateTime()
as_dict()
dtoolcore.utils.timestamp(self.frozen_at)
Not sure whether this issue would still persist, a lot has changed on the code since first encountered in https://github.com/jic-dtool/dtool-lookup-server/pull/24.
Not sure about this. I think it is a datetime in the SQL DB to potentially do clever filtering.
Originally,
sql_models.Dataset(db.Model)
defines columnsfrozen_at
andcreated_at
asdb.DateTime()
, its methodas_dict()
converts those withdtoolcore.utils.timestamp(self.frozen_at)
. This, however, results in the autogenerated client API to expect a serialized datetime object and to throw an exception when receiving float. Treat created_at and frozen_at as floats in schema with https://github.com/jotelha/dtool-lookup-server/blob/9d1b8cc751f1d1e143bae10d9454d86be438dc13/dtool_lookup_server/sql_models.py#L122-L128 as suggested below https://marshmallow.readthedocs.io/en/latest/quickstart.html#implicit-field-creation.Not sure whether this issue would still persist, a lot has changed on the code since first encountered in https://github.com/jic-dtool/dtool-lookup-server/pull/24.