From 38e72c0c3ab69af8571891532773e8d19d530d5c Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 23 Sep 2017 11:00:37 -0700 Subject: [PATCH] Make `notnulls` set instead of list. --- etiquette/photodb.py | 10 +++++----- etiquette/searchhelpers.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index 0f11b61..d02ba17 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -630,15 +630,15 @@ class PDBPhotoMixin: searchhelpers.minmax('duration', duration, minimums, maximums, warning_bag=warning_bag) orderby = searchhelpers.normalize_orderby(orderby) - notnulls = [] + notnulls = set() if extension or mimetype: - notnulls.append('extension') + notnulls.add('extension') if width or height or ratio or area: - notnulls.append('width') + notnulls.add('width') if bytes: - notnulls.append('bytes') + notnulls.add('bytes') if duration: - notnulls.append('duration') + notnulls.add('duration') if orderby is None: giveback_orderby = None diff --git a/etiquette/searchhelpers.py b/etiquette/searchhelpers.py index 5495680..b23d8fe 100644 --- a/etiquette/searchhelpers.py +++ b/etiquette/searchhelpers.py @@ -20,7 +20,7 @@ def build_query(orderby, notnulls, minimums, maximums, mmf_results=None): for (column, direction) in orderby: if column != 'RANDOM()': - notnulls.append(column) + notnulls.add(column) for column in notnulls: wheres.append(column + ' IS NOT NULL')