2020-02-09 03:20:59 -05:00
|
|
|
#
|
|
|
|
# Filter lookup expressions
|
|
|
|
#
|
|
|
|
|
|
|
|
FILTER_CHAR_BASED_LOOKUP_MAP = dict(
|
|
|
|
n='exact',
|
|
|
|
ic='icontains',
|
|
|
|
nic='icontains',
|
|
|
|
iew='iendswith',
|
|
|
|
niew='iendswith',
|
|
|
|
isw='istartswith',
|
|
|
|
nisw='istartswith',
|
|
|
|
ie='iexact',
|
2021-07-01 15:17:46 -04:00
|
|
|
nie='iexact',
|
|
|
|
empty='empty',
|
2020-02-09 03:20:59 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
FILTER_NUMERIC_BASED_LOOKUP_MAP = dict(
|
|
|
|
n='exact',
|
|
|
|
lte='lte',
|
|
|
|
lt='lt',
|
|
|
|
gte='gte',
|
2023-08-28 15:10:51 -04:00
|
|
|
gt='gt',
|
|
|
|
empty='isnull',
|
2020-02-09 03:20:59 -05:00
|
|
|
)
|
|
|
|
|
2020-02-18 00:32:58 -05:00
|
|
|
FILTER_NEGATION_LOOKUP_MAP = dict(
|
|
|
|
n='exact'
|
|
|
|
)
|
|
|
|
|
2020-02-28 19:58:06 -05:00
|
|
|
FILTER_TREENODE_NEGATION_LOOKUP_MAP = dict(
|
|
|
|
n='in'
|
|
|
|
)
|
|
|
|
|
2020-06-29 03:50:05 -04:00
|
|
|
#
|
|
|
|
# HTTP Request META safe copy
|
|
|
|
#
|
|
|
|
|
|
|
|
HTTP_REQUEST_META_SAFE_COPY = [
|
|
|
|
'CONTENT_LENGTH',
|
|
|
|
'CONTENT_TYPE',
|
|
|
|
'HTTP_ACCEPT',
|
|
|
|
'HTTP_ACCEPT_ENCODING',
|
|
|
|
'HTTP_ACCEPT_LANGUAGE',
|
|
|
|
'HTTP_HOST',
|
|
|
|
'HTTP_REFERER',
|
|
|
|
'HTTP_USER_AGENT',
|
2021-11-19 15:20:00 -05:00
|
|
|
'HTTP_X_FORWARDED_FOR',
|
2023-08-24 21:48:32 +05:30
|
|
|
'HTTP_X_FORWARDED_HOST',
|
|
|
|
'HTTP_X_FORWARDED_PORT',
|
|
|
|
'HTTP_X_FORWARDED_PROTO',
|
|
|
|
'HTTP_X_REAL_IP',
|
2020-06-29 03:50:05 -04:00
|
|
|
'QUERY_STRING',
|
|
|
|
'REMOTE_ADDR',
|
|
|
|
'REMOTE_HOST',
|
|
|
|
'REMOTE_USER',
|
|
|
|
'REQUEST_METHOD',
|
|
|
|
'SERVER_NAME',
|
|
|
|
'SERVER_PORT',
|
|
|
|
]
|
2023-09-13 02:18:40 +05:30
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# CSV-style format delimiters
|
|
|
|
#
|
|
|
|
|
|
|
|
CSV_DELIMITERS = {
|
|
|
|
'comma': ',',
|
|
|
|
'semicolon': ';',
|
|
|
|
'tab': '\t',
|
|
|
|
}
|
2024-01-11 06:31:32 -08:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# HTML allowed tags & attributes
|
|
|
|
#
|
|
|
|
|
|
|
|
HTML_ALLOWED_TAGS = {
|
|
|
|
"a", "b", "blockquote", "br", "code", "dd", "del", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6",
|
|
|
|
"hr", "i", "img", "li", "ol", "p", "pre", "strong", "table", "tbody", "td", "th", "thead", "tr", "ul"
|
|
|
|
}
|
|
|
|
|
|
|
|
HTML_ALLOWED_ATTRIBUTES = {
|
|
|
|
"a": {"href", "title"},
|
|
|
|
"div": {"class"},
|
|
|
|
"h1": {"id"},
|
|
|
|
"h2": {"id"},
|
|
|
|
"h3": {"id"},
|
|
|
|
"h4": {"id"},
|
|
|
|
"h5": {"id"},
|
|
|
|
"h6": {"id"},
|
|
|
|
"img": {"alt", "src", "title"},
|
|
|
|
"td": {"align"},
|
|
|
|
"th": {"align"},
|
|
|
|
}
|