Traceback (most recent call last):
File "use_it.py", line 5, in <module>
mother.children.age = 12
File "/usr/local/lib/python3.4/dist-packages/protobuf3/fields/base.py", line 82, in __set__
self._convert_to_wire_type(value))
File "/usr/local/lib/python3.4/dist-packages/protobuf3/message.py", line 168, in _set_wire_values
msg._set_wire_values(number, FIELD_VARIABLE_LENGTH, self.encode_to_bytes(), idx)
File "/usr/local/lib/python3.4/dist-packages/protobuf3/message.py", line 184, in encode_to_bytes
self._check_required_fields()
File "/usr/local/lib/python3.4/dist-packages/protobuf3/message.py", line 144, in _check_required_fields
raise KeyError("Some required fields are missing: " + ", ".join(missing_fields))
KeyError: 'Some required fields are missing: name'
When we set the age, the name isn't set yet, so this error is thrown. Maybe it can be fixed with a temporary object that hold the age while waiting for the name to be chosen, and when every required field has gotten its value, set them all at once?
When I set a field in an embedded message and there are required fields left to set, for example, in that case:
This exception is thrown:
When we set the age, the name isn't set yet, so this error is thrown. Maybe it can be fixed with a temporary object that hold the age while waiting for the name to be chosen, and when every required field has gotten its value, set them all at once?