I'm tyring to recreate this query in SQL Alchamey but I've been unable to nest the filters:
Query:
SELECT * FROM calendar
where (recurrenceRule = '')
or (recurrenceRule != '' and start < @end1);
Python:
events.filter(or_(Calendar.recurrenceRule!='',
(Calendar.recurrenceRule=='',Calendar.start>=filterStart))
This python results in the following exception: "SQL expression object or string expected."
You must use and_
explicitly:
events.filter(or_(
Calendar.recurrenceRule!='',
and_(Calendar.recurrenceRule=='', Calendar.start>=filterStart))
)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments