|
@@ -120,7 +120,10 @@ class Command(BaseCommand):
|
|
|
|
|
|
@staticmethod
|
|
|
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']:
|
|
|
try:
|
|
|
kwargs = ujson.loads(options['filter'])
|
|
@@ -130,7 +133,10 @@ class Command(BaseCommand):
|
|
|
raise CommandError('Bad filter kwargs!')
|
|
|
|
|
|
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:
|
|
|
raise CommandError('Bad filter kwargs! {0}'.format(str(e)))
|
|
|
|