'Cannot convert to a Firestore Value', datetime.date(2004, 1, 16)
raise TypeError(
TypeError: ('Cannot convert to a Firestore Value', datetime.date(2004, 1, 16), 'Invalid type', <class 'datetime.date'>)
Related documentation
https://firebase.google.com/docs/firestore/manage-data/data-types
def to_json(self):
137 import pdb;pdb.set_trace()
138 json = {
139 -> "id" : self.id,
140 "vehicle_merk" : self.vehicle_merk.name,
141 "vehicle_model": self.vehicle_model.name,
142 "price": str(self.price),
143 "created": self.created , #strftime("%Y-%m-%dT%H:%M:%SZ"), # strftime("%Y_%m_%d_%H_%M_%S_%f")
144 "fuel_type": self.fuel_type,
(Pdb) type(self.created)
<class 'datetime.datetime'>
(Pdb) type(self.first_registration)
<class 'datetime.date'>
Comments
Post a Comment