mirror of https://github.com/django/django.git
Switch a datastructure internal to the ORM to be a set, instead of a dictionary.
This commit is contained in:
parent
6ff118cdb9
commit
d5a277ba4d
|
@ -9,7 +9,7 @@ from django.contrib.gis.geometry.backend import Geometry
|
||||||
from django.contrib.gis.measure import Area, Distance
|
from django.contrib.gis.measure import Area, Distance
|
||||||
|
|
||||||
|
|
||||||
ALL_TERMS = dict([(x, None) for x in (
|
ALL_TERMS = set([
|
||||||
'bbcontains', 'bboverlaps', 'contained', 'contains',
|
'bbcontains', 'bboverlaps', 'contained', 'contains',
|
||||||
'contains_properly', 'coveredby', 'covers', 'crosses', 'disjoint',
|
'contains_properly', 'coveredby', 'covers', 'crosses', 'disjoint',
|
||||||
'distance_gt', 'distance_gte', 'distance_lt', 'distance_lte',
|
'distance_gt', 'distance_gte', 'distance_lt', 'distance_lte',
|
||||||
|
@ -18,7 +18,7 @@ ALL_TERMS = dict([(x, None) for x in (
|
||||||
'left', 'right', 'overlaps_left', 'overlaps_right',
|
'left', 'right', 'overlaps_left', 'overlaps_right',
|
||||||
'overlaps_above', 'overlaps_below',
|
'overlaps_above', 'overlaps_below',
|
||||||
'strictly_above', 'strictly_below'
|
'strictly_above', 'strictly_below'
|
||||||
)])
|
])
|
||||||
ALL_TERMS.update(sql.constants.QUERY_TERMS)
|
ALL_TERMS.update(sql.constants.QUERY_TERMS)
|
||||||
|
|
||||||
class GeoQuery(sql.Query):
|
class GeoQuery(sql.Query):
|
||||||
|
|
|
@ -2,11 +2,11 @@ from collections import namedtuple
|
||||||
import re
|
import re
|
||||||
|
|
||||||
# Valid query types (a dictionary is used for speedy lookups).
|
# 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',
|
'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
|
||||||
'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
|
'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
|
||||||
'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
|
'month', 'day', 'week_day', 'isnull', 'search', 'regex', 'iregex',
|
||||||
)])
|
])
|
||||||
|
|
||||||
# Size of each "chunk" for get_iterator calls.
|
# Size of each "chunk" for get_iterator calls.
|
||||||
# Larger values are slightly faster at the expense of more storage space.
|
# Larger values are slightly faster at the expense of more storage space.
|
||||||
|
|
Loading…
Reference in New Issue