def get_creator_id(db): const = Factory.get('Constants')(db) entity_name = Entity.EntityName(db) entity_name.find_by_name(cereconf.INITIAL_ACCOUNTNAME, const.account_namespace) id = entity_name.entity_id return id
def fetch_name(entity_id, db): """Fetch entity_id's name, ignoring errors if it does not exist. """ ent = Entity.EntityName(db) try: ent.find(int(entity_id)) return ", ".join(x["name"] for x in ent.get_names()) except Errors.NotFoundError: return ""