def lock_delete(self):
if self.products.exists():
return _("Cannot delete category model, relationship between category model and products")
elif self.features.exists():
return _("Cannot delete category model, relationship between category model and features")
elif self.attributes.exists():
return _("Cannot delete category model, relationship between category model and attributes")
elif self.feature_specials.exists():
return _("Cannot delete category model, relationship between category model and feature special")
elif self.subcategory.exists():
return _("Cannot delete category model, relationship between category model and subcategories")
else:
return super(Category, self).lock_delete()
# subcategorias
评论列表
文章目录