Skip to content

Commit d5a277b

Browse files
committed
Switch a datastructure internal to the ORM to be a set, instead of a dictionary.
1 parent 6ff118c commit d5a277b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

django/contrib/gis/db/models/sql/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from django.contrib.gis.measure import Area, Distance
1010

1111

12-
ALL_TERMS = dict([(x, None) for x in (
12+
ALL_TERMS = set([
1313
'bbcontains', 'bboverlaps', 'contained', 'contains',
1414
'contains_properly', 'coveredby', 'covers', 'crosses', 'disjoint',
1515
'distance_gt', 'distance_gte', 'distance_lt', 'distance_lte',
@@ -18,7 +18,7 @@
1818
'left', 'right', 'overlaps_left', 'overlaps_right',
1919
'overlaps_above', 'overlaps_below',
2020
'strictly_above', 'strictly_below'
21-
)])
21+
])
2222
ALL_TERMS.update(sql.constants.QUERY_TERMS)
2323

2424
class GeoQuery(sql.Query):

django/db/models/sql/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import re
33

44
# Valid query types (a dictionary is used for speedy lookups).
5-
QUERY_TERMS = dict([(x, None) for x in (
5+
QUERY_TERMS = set([
66
'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
77
'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
88
'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
9-
)])
9+
])
1010

1111
# Size of each "chunk" for get_iterator calls.
1212
# Larger values are slightly faster at the expense of more storage space.

0 commit comments

Comments
 (0)