'ISSUES:
* Delete child entities. Have not found cases where this is a problem. So far,
clients are deleting all CouchDBs documents properly, and if they don\'t, the
DBs still are consistent. Maybe use SQLAlchemy\'s cascades if this become a
problem. Status: Somewhat OK
* Doc ID maps to multiple elements. This could happen since the ID is a hash
based in a few entity\'s properties which can be replicated. Status: TODO'

def delete_entity_from_doc_id(self, document_id):

    entity = self.__get_modified_entity(document_id)
    if (entity is not None):
        self.__db_conn.session.delete(entity)
        self.__db_conn.session.commit()
        logger.info(u'A    {}    ({})    was    deleted    in    Workspace    {}'.format(entity.entity_metadata.document_type, getattr(entity, 'name', '<no-name>'), self.__db_conn.db_name))
        return True
    logger.debug(u'Document    ({})    was    not    present    in    database    to    delete'.format(document_id))
    return False
