i want to delete all the records which having the company.id
in model AclRoleAccess
AclRoleAccess(models.Model):
acl_role = models.ForeignKey(ACLRoles, on_delete=models.CASCADE)
acl_company = models.ForeignKey(Company, on_delete=models.CASCADE)
acl_functionality = models.ForeignKey(AclFunctionality, on_delete=models.CASCADE)
acl_has_access = models.BooleanField()
class Meta:
db_table = "acl_role_accesses"
@receiver(pre_save, sender=AclRoleAccess)
def delete_AclRoleAccess(sender, instance, update_fields=None, **kwargs):
print('Delete These', instance)