constants.py 638 B

1234567891011121314151617181920212223242526
  1. """
  2. Constants specific to the SQL storage portion of the ORM.
  3. """
  4. from django.utils.regex_helper import _lazy_re_compile
  5. # Size of each "chunk" for get_iterator calls.
  6. # Larger values are slightly faster at the expense of more storage space.
  7. GET_ITERATOR_CHUNK_SIZE = 100
  8. # Namedtuples for sql.* internal use.
  9. # How many results to expect from a cursor.execute call
  10. MULTI = 'multi'
  11. SINGLE = 'single'
  12. CURSOR = 'cursor'
  13. NO_RESULTS = 'no results'
  14. ORDER_DIR = {
  15. 'ASC': ('ASC', 'DESC'),
  16. 'DESC': ('DESC', 'ASC'),
  17. }
  18. ORDER_PATTERN = _lazy_re_compile(r'[-+]?[.\w]+$')
  19. # SQL join types.
  20. INNER = 'INNER JOIN'
  21. LOUTER = 'LEFT OUTER JOIN'