|
@@ -103,7 +103,10 @@ class ReplicaManager(Manager):
|
|
|
pk_value = mapped_data[pk_name]
|
|
|
f_kwargs = {pk_name: pk_value}
|
|
|
|
|
|
- qs = self.model._default_manager.filter(**f_kwargs).order_by()
|
|
|
+ if hasattr(self.model, 'objects_all'): # wxl 2023-8-16
|
|
|
+ qs = self.model.objects_all.filter(**f_kwargs).order_by()
|
|
|
+ else:
|
|
|
+ qs = self.model._default_manager.filter(**f_kwargs).order_by()
|
|
|
if self.model.CQRS_SELECT_FOR_UPDATE:
|
|
|
qs = qs.select_for_update()
|
|
|
|
|
@@ -277,7 +280,10 @@ class ReplicaManager(Manager):
|
|
|
pk_name = self._get_model_pk_name()
|
|
|
pk_value = mapped_data[pk_name]
|
|
|
try:
|
|
|
- self.model._default_manager.filter(**{pk_name: pk_value}).delete()
|
|
|
+ if hasattr(self.model, 'objects_all'): # wxl 2023-8-16
|
|
|
+ self.model.objects_all.filter(**{pk_name: pk_value}).delete()
|
|
|
+ else:
|
|
|
+ self.model._default_manager.filter(**{pk_name: pk_value}).delete()
|
|
|
return True
|
|
|
except Error as e:
|
|
|
logger.error(
|