diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2012-09-08 19:51:36 -0400 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2012-09-08 19:51:36 -0400 |
| commit | c4aa26a983c91b1ec015fe0552077847116dfab7 (patch) | |
| tree | da105a932b737c0f42504a2bdf236178afe25160 /django/db/models/sql/constants.py | |
| parent | a78dd109e6c81c49e90e36e9b793bad67c46c23c (diff) | |
Internal refactoring; moving LOOKUP_SEP up one level.
In an ideal world, nothing except django.db.models.query should have to
import stuff from django.models.sql.*. A few things were needing to get
hold of sql.constants.LOOKUP_SEP, so this commit moves it up to
django.db.models.constants.LOOKUP_SEP.
There are still a couple of places (admin) poking into sql.* to get
QUERY_TERMS, which is unfortunate, but a slightly different issue and
harder to adjust.
Diffstat (limited to 'django/db/models/sql/constants.py')
| -rw-r--r-- | django/db/models/sql/constants.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/django/db/models/sql/constants.py b/django/db/models/sql/constants.py index b9cf2c96fd..f750310624 100644 --- a/django/db/models/sql/constants.py +++ b/django/db/models/sql/constants.py @@ -1,7 +1,13 @@ +""" +Constants specific to the SQL storage portion of the ORM. +""" + from collections import namedtuple import re -# Valid query types (a set is used for speedy lookups). +# Valid query types (a set is used for speedy lookups). These are (currently) +# considered SQL-specific; other storage systems may choose to use different +# lookup types. QUERY_TERMS = set([ 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in', 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year', @@ -12,9 +18,6 @@ QUERY_TERMS = set([ # Larger values are slightly faster at the expense of more storage space. GET_ITERATOR_CHUNK_SIZE = 100 -# Separator used to split filter strings apart. -LOOKUP_SEP = '__' - # Constants to make looking up tuple values clearer. # Join lists (indexes into the tuples that are values in the alias_map # dictionary in the Query class). |
