|
@@ -2,7 +2,6 @@ import copy
|
|
import datetime
|
|
import datetime
|
|
import functools
|
|
import functools
|
|
import inspect
|
|
import inspect
|
|
-import warnings
|
|
|
|
from collections import defaultdict
|
|
from collections import defaultdict
|
|
from decimal import Decimal
|
|
from decimal import Decimal
|
|
from uuid import UUID
|
|
from uuid import UUID
|
|
@@ -13,7 +12,6 @@ from django.db.models import fields
|
|
from django.db.models.constants import LOOKUP_SEP
|
|
from django.db.models.constants import LOOKUP_SEP
|
|
from django.db.models.query_utils import Q
|
|
from django.db.models.query_utils import Q
|
|
from django.utils.deconstruct import deconstructible
|
|
from django.utils.deconstruct import deconstructible
|
|
-from django.utils.deprecation import RemovedInDjango50Warning
|
|
|
|
from django.utils.functional import cached_property
|
|
from django.utils.functional import cached_property
|
|
from django.utils.hashable import make_hashable
|
|
from django.utils.hashable import make_hashable
|
|
|
|
|
|
@@ -1571,16 +1569,7 @@ class OrderBy(Expression):
|
|
if nulls_first and nulls_last:
|
|
if nulls_first and nulls_last:
|
|
raise ValueError("nulls_first and nulls_last are mutually exclusive")
|
|
raise ValueError("nulls_first and nulls_last are mutually exclusive")
|
|
if nulls_first is False or nulls_last is False:
|
|
if nulls_first is False or nulls_last is False:
|
|
-
|
|
+ raise ValueError("nulls_first and nulls_last values must be True or None.")
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- warnings.warn(
|
|
|
|
- "Passing nulls_first=False or nulls_last=False is deprecated, use None "
|
|
|
|
- "instead.",
|
|
|
|
- RemovedInDjango50Warning,
|
|
|
|
- stacklevel=2,
|
|
|
|
- )
|
|
|
|
self.nulls_first = nulls_first
|
|
self.nulls_first = nulls_first
|
|
self.nulls_last = nulls_last
|
|
self.nulls_last = nulls_last
|
|
self.descending = descending
|
|
self.descending = descending
|