def create(entity: dict, dao: GenericSQLDAO = None): entity_to_create = EntityForTest(**entity) dao.create(entity=entity_to_create) return success_response(message="EntityForTest created", data={"EntityForTest": dict(entity_to_create)})
def create(id_: str, entity: dict, dao: GenericSQLDAO = None): entity_to_create = Phone(**entity) entity_to_create.contact = Contact(id_=id_) dao.create(entity=entity_to_create) return success_response(message="Phone created", data={"Phone": dict(entity_to_create)})