support to_python_on_init flag on a field