Created
May 30, 2017 12:34
-
-
Save kezabelle/b7ff8058530523b3ff8966d13a320985 to your computer and use it in GitHub Desktop.
For MrGrj in #django IRC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| q = self.request.GET.get('q') | |
| items = ('frq_id', 'line_cls', 'technology_id', 'type_id', 'line_capacity_id', 'el_intf_type_a', 'location_a_id', 'location_z_id', 'comments', 'opened_at', 'opened_by', 'finalised', 'attach_id', 'location_a_id_old', 'offer_deadline', 'location_z_id_old', 'el_intf_type_z', 'cancelled', 'qinq', 'flow_type_id') | |
| itemdicts = ({'{}__contains'.format(item): x} for item in items) | |
| itemqs = (Q(**itemd) for itemd in itemdicts) | |
| itemq = reduce(operator.or_, itemqs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment