code: def delete(self, user):
          
          if user:
              can_delete = yield self.can_delete(user)
          else:
              can_delete = False
  
          if not can_delete:
              raise exceptions.Unauthorized('User may not delete the resource')
  
          try:
              parent = yield self.get_parent()
          except couch.NotFound:
              msg = '{}_id {} not found'.format(
                  self.parent_resource.resource_type,
                  self.parent_id)
              raise exceptions.ValidationError(msg)
  
          yield parent.delete_subresource(self)
docs: Delete a sub-resource