You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 22, 2022. It is now read-only.
I think reading the code that lifter supports value_in lists query. I cannot find any example or tip on how to implement this in my filter.
Also startswith and other lookups would be nice to have them documented.
My data is a simple list of dictionaries, and list is a list.
Hello and sorry for my late answer, I was actually in a vacation trip :)
You can indeed use in, but with the myfield__value_in lookup:
objects.filter(eye_color__value_in=['brown'])
The fact is Python does not allows to override the __contains__ to return a non-boolean value. This is quite strange, considering you can do this for other lookups such as __eq__.
If you want to combine queries, you can also use the value_in operator object directly:
I am thinking how to add this information improved with extra expressions like contains etc to the docs. Could you please keep this issue open meanwhile?
I think reading the code that lifter supports value_in lists query. I cannot find any example or tip on how to implement this in my filter.
Also startswith and other lookups would be nice to have them documented.
My data is a simple list of dictionaries, and list is a list.
Doesn't work:
sent_messages = objects.filter(folder__in = sent_folders)
Doesn't work:
sent_messages = objects.filter(Message.folder in sent_folders)
Combining Nodes section is not helpful either.
qn = (Message.date > this_year) & (Message.folder == 'INBOX.Sent') | (Message.folder == 'Sent') | (Message.folder == 'Enviados') | (Message.folder == 'INBOX.Enviados')
sent_query = lifter.query.Query(action='select', filters=qn)
sent_messages = objects.filter(sent_query)
Please help! :)
The text was updated successfully, but these errors were encountered: