equal
deleted
inserted
replaced
|
1 import re |
|
2 |
|
3 # Valid query types (a dictionary is used for speedy lookups). |
|
4 QUERY_TERMS = dict([(x, None) for x in ( |
|
5 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in', |
|
6 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year', |
|
7 'month', 'day', 'isnull', 'search', 'regex', 'iregex', |
|
8 )]) |
|
9 |
|
10 # Size of each "chunk" for get_iterator calls. |
|
11 # Larger values are slightly faster at the expense of more storage space. |
|
12 GET_ITERATOR_CHUNK_SIZE = 100 |
|
13 |
|
14 # Separator used to split filter strings apart. |
|
15 LOOKUP_SEP = '__' |
|
16 |
|
17 # Constants to make looking up tuple values clearer. |
|
18 # Join lists |
|
19 TABLE_NAME = 0 |
|
20 RHS_ALIAS = 1 |
|
21 JOIN_TYPE = 2 |
|
22 LHS_ALIAS = 3 |
|
23 LHS_JOIN_COL = 4 |
|
24 RHS_JOIN_COL = 5 |
|
25 NULLABLE = 6 |
|
26 |
|
27 # How many results to expect from a cursor.execute call |
|
28 MULTI = 'multi' |
|
29 SINGLE = 'single' |
|
30 |
|
31 ORDER_PATTERN = re.compile(r'\?|[-+]?[.\w]+$') |
|
32 ORDER_DIR = { |
|
33 'ASC': ('ASC', 'DESC'), |
|
34 'DESC': ('DESC', 'ASC')} |
|
35 |
|
36 |