diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2019-10-26 16:42:32 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-10-29 09:22:26 +0100 |
| commit | e3d0b4d5501c6d0bc39f035e4345e5bdfde12e41 (patch) | |
| tree | a8ddbafdf4a38a87df6f65fc4d02dba08c725096 /django/db/models/sql/constants.py | |
| parent | 39a34d4bf94bc8325119bc23b64f3a041a85dd2d (diff) | |
Fixed #30899 -- Lazily compiled import time regular expressions.
Diffstat (limited to 'django/db/models/sql/constants.py')
| -rw-r--r-- | django/db/models/sql/constants.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/sql/constants.py b/django/db/models/sql/constants.py index 28f4242a7a..1ff44252c5 100644 --- a/django/db/models/sql/constants.py +++ b/django/db/models/sql/constants.py @@ -2,7 +2,7 @@ Constants specific to the SQL storage portion of the ORM. """ -import re +from django.utils.regex_helper import _lazy_re_compile # Size of each "chunk" for get_iterator calls. # Larger values are slightly faster at the expense of more storage space. @@ -16,7 +16,7 @@ SINGLE = 'single' CURSOR = 'cursor' NO_RESULTS = 'no results' -ORDER_PATTERN = re.compile(r'\?|[-+]?[.\w]+$') +ORDER_PATTERN = _lazy_re_compile(r'\?|[-+]?[.\w]+$') ORDER_DIR = { 'ASC': ('ASC', 'DESC'), 'DESC': ('DESC', 'ASC'), |
