Hello.
My angular is using a datepicker to send a date in string format(ex:
2018-09-11) to my flask app to postgres via sqlalchemy.
In my postgres all rows have a column ef_time of timestamps type.(ex:
2018-09-07
13:24:30.138)
@app.route('/orders/<ide>')
def get_orders(ide):
session = Session()
orders_objects = session.query(Orders).filter(Orders.ef_time.like(ide+"%")).
all()
schema = OrdersSchema(many=True)
orders = schema.dump(orders_objects)
session.close()
return json.dumps(orders.data)
When sending a test, /orders/2018-09-11 my flask app gives me an error:
operator does not exist: timestamp without time zone ~~~unknown.
Line3: Where ord7.ef_time LIKE '2018-09-11%' because, obviously i am seding
a string and my ef_time column is of type datestamp without timezone in
postgres.
Please give some support, i don't know how to get out this situation. king
regards.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.