|
@@ -120,7 +120,10 @@ class Command(BaseCommand):
|
|
|
|
|
|
@staticmethod
|
|
@staticmethod
|
|
def _prepare_qs(model, options):
|
|
def _prepare_qs(model, options):
|
|
- qs = model._default_manager.none()
|
|
|
|
|
|
+ if hasattr(model, 'objects_all'): # wxl 2023-8-29
|
|
|
|
+ qs = model.objects_all.none()
|
|
|
|
+ else:
|
|
|
|
+ qs = model._default_manager.none()
|
|
if options['filter']:
|
|
if options['filter']:
|
|
try:
|
|
try:
|
|
kwargs = ujson.loads(options['filter'])
|
|
kwargs = ujson.loads(options['filter'])
|
|
@@ -130,7 +133,10 @@ class Command(BaseCommand):
|
|
raise CommandError('Bad filter kwargs!')
|
|
raise CommandError('Bad filter kwargs!')
|
|
|
|
|
|
try:
|
|
try:
|
|
- qs = model._default_manager.filter(**kwargs).order_by()
|
|
|
|
|
|
+ if hasattr(model, 'objects_all'): # wxl 2023-8-29
|
|
|
|
+ qs = model.objects_all.filter(**kwargs).order_by()
|
|
|
|
+ else:
|
|
|
|
+ qs = model._default_manager.filter(**kwargs).order_by()
|
|
except FieldError as e:
|
|
except FieldError as e:
|
|
raise CommandError('Bad filter kwargs! {0}'.format(str(e)))
|
|
raise CommandError('Bad filter kwargs! {0}'.format(str(e)))
|
|
|
|
|