I am using SQLObject, a wrapper for python to manage SQL Queries, with Python 2.7. I know I can select data by using a dictionary such as:
restrictions = { ... }
selection = sql_table.selectBy(**restrictions).orderBy('-createdtime')
I can also query for date by doing:
selection = sql_table.select(sql_table.q.creatdtime>=datetime.datetime(year, month, day, 0, 0, 0, 0)
However, I want to use both together to sort by the date as well as the dictionary pairings. When I try to put them together like this:
selection = sql_table.select(**restrictions, sql_table.q.creatdtime>=datetime.datetime(year, month, day, 0, 0, 0, 0)
It doesn't work. Is there any way to filter the SQL query by a range of datetime and by the dictionary pairings?