File: types.py

package info (click to toggle)
python-boto 2.49.0-4.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,888 kB
  • sloc: python: 86,396; makefile: 112
file content (44 lines) | stat: -rw-r--r-- 932 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Shadow the DynamoDB v1 bits.
# This way, no end user should have to cross-import between versions & we
# reserve the namespace to extend v2 if it's ever needed.
from boto.dynamodb.types import NonBooleanDynamizer, Dynamizer


# Some constants for our use.
STRING = 'S'
NUMBER = 'N'
BINARY = 'B'
STRING_SET = 'SS'
NUMBER_SET = 'NS'
BINARY_SET = 'BS'
NULL = 'NULL'
BOOLEAN = 'BOOL'
MAP = 'M'
LIST = 'L'

QUERY_OPERATORS = {
    'eq': 'EQ',
    'lte': 'LE',
    'lt': 'LT',
    'gte': 'GE',
    'gt': 'GT',
    'beginswith': 'BEGINS_WITH',
    'between': 'BETWEEN',
}

FILTER_OPERATORS = {
    'eq': 'EQ',
    'ne': 'NE',
    'lte': 'LE',
    'lt': 'LT',
    'gte': 'GE',
    'gt': 'GT',
    # FIXME: Is this necessary? i.e. ``whatever__null=False``
    'nnull': 'NOT_NULL',
    'null': 'NULL',
    'contains': 'CONTAINS',
    'ncontains': 'NOT_CONTAINS',
    'beginswith': 'BEGINS_WITH',
    'in': 'IN',
    'between': 'BETWEEN',
}