constants.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #
  2. # Filter lookup expressions
  3. #
  4. FILTER_CHAR_BASED_LOOKUP_MAP = dict(
  5. n='exact',
  6. ic='icontains',
  7. nic='icontains',
  8. iew='iendswith',
  9. niew='iendswith',
  10. isw='istartswith',
  11. nisw='istartswith',
  12. ie='iexact',
  13. nie='iexact'
  14. )
  15. FILTER_NUMERIC_BASED_LOOKUP_MAP = dict(
  16. n='exact',
  17. lte='lte',
  18. lt='lt',
  19. gte='gte',
  20. gt='gt'
  21. )
  22. FILTER_NEGATION_LOOKUP_MAP = dict(
  23. n='exact'
  24. )
  25. FILTER_TREENODE_NEGATION_LOOKUP_MAP = dict(
  26. n='in'
  27. )
  28. # Keys for PostgreSQL advisory locks. These are arbitrary bigints used by
  29. # the advisory_lock contextmanager. When a lock is acquired,
  30. # one of these keys will be used to identify said lock.
  31. #
  32. # When adding a new key, pick something arbitrary and unique so
  33. # that it is easily searchable in query logs.
  34. ADVISORY_LOCK_KEYS = {
  35. 'available-prefixes': 100100,
  36. 'available-ips': 100200,
  37. }
  38. #
  39. # HTTP Request META safe copy
  40. #
  41. HTTP_REQUEST_META_SAFE_COPY = [
  42. 'CONTENT_LENGTH',
  43. 'CONTENT_TYPE',
  44. 'HTTP_ACCEPT',
  45. 'HTTP_ACCEPT_ENCODING',
  46. 'HTTP_ACCEPT_LANGUAGE',
  47. 'HTTP_HOST',
  48. 'HTTP_REFERER',
  49. 'HTTP_USER_AGENT',
  50. 'QUERY_STRING',
  51. 'REMOTE_ADDR',
  52. 'REMOTE_HOST',
  53. 'REMOTE_USER',
  54. 'REQUEST_METHOD',
  55. 'SERVER_NAME',
  56. 'SERVER_PORT',
  57. ]