Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…dictionary.
  • Loading branch information...
commit d5a277ba4d608284991428fc3f7d6e0dbe6f8300 1 parent 6ff118c
@alex alex authored
View
4 django/contrib/gis/db/models/sql/query.py
@@ -9,7 +9,7 @@
from django.contrib.gis.measure import Area, Distance
-ALL_TERMS = dict([(x, None) for x in (
+ALL_TERMS = set([
'bbcontains', 'bboverlaps', 'contained', 'contains',
'contains_properly', 'coveredby', 'covers', 'crosses', 'disjoint',
'distance_gt', 'distance_gte', 'distance_lt', 'distance_lte',
@@ -18,7 +18,7 @@
'left', 'right', 'overlaps_left', 'overlaps_right',
'overlaps_above', 'overlaps_below',
'strictly_above', 'strictly_below'
- )])
+ ])
ALL_TERMS.update(sql.constants.QUERY_TERMS)
class GeoQuery(sql.Query):
View
4 django/db/models/sql/constants.py
@@ -2,11 +2,11 @@
import re
# Valid query types (a dictionary is used for speedy lookups).
-QUERY_TERMS = dict([(x, None) for x in (
+QUERY_TERMS = set([
'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
-)])
+])
# Size of each "chunk" for get_iterator calls.
# Larger values are slightly faster at the expense of more storage space.
Please sign in to comment.
Something went wrong with that request. Please try again.