Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Switch a datastructure internal to the ORM to be a set, instead of a …

…dictionary.
  • Loading branch information...
commit d5a277ba4d608284991428fc3f7d6e0dbe6f8300 1 parent 6ff118c
Alex Gaynor authored April 29, 2012
4  django/contrib/gis/db/models/sql/query.py
@@ -9,7 +9,7 @@
9 9
 from django.contrib.gis.measure import Area, Distance
10 10
 
11 11
 
12  
-ALL_TERMS = dict([(x, None) for x in (
  12
+ALL_TERMS = set([
13 13
             'bbcontains', 'bboverlaps', 'contained', 'contains',
14 14
             'contains_properly', 'coveredby', 'covers', 'crosses', 'disjoint',
15 15
             'distance_gt', 'distance_gte', 'distance_lt', 'distance_lte',
@@ -18,7 +18,7 @@
18 18
             'left', 'right', 'overlaps_left', 'overlaps_right',
19 19
             'overlaps_above', 'overlaps_below',
20 20
             'strictly_above', 'strictly_below'
21  
-            )])
  21
+            ])
22 22
 ALL_TERMS.update(sql.constants.QUERY_TERMS)
23 23
 
24 24
 class GeoQuery(sql.Query):
4  django/db/models/sql/constants.py
@@ -2,11 +2,11 @@
2 2
 import re
3 3
 
4 4
 # Valid query types (a dictionary is used for speedy lookups).
5  
-QUERY_TERMS = dict([(x, None) for x in (
  5
+QUERY_TERMS = set([
6 6
     'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
7 7
     'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
8 8
     'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
9  
-)])
  9
+])
10 10
 
11 11
 # Size of each "chunk" for get_iterator calls.
12 12
 # Larger values are slightly faster at the expense of more storage space.

0 notes on commit d5a277b

Please sign in to comment.
Something went wrong with that request. Please try again.