All, Apologies in advance for the novice question, but I cannot figure out how to set the value of a nested, non repeating message. For repeating message types I can define a variable as the nested message with .add() and then being setting parameters in a straight-forward fashion. For non-repeating message types though, I cannot make this work.
I have the following schema:
syntax="proto2";
package pkgName;
message OuterLayer
{
required string thing = 1;
message InnerLayer
{
optional string otherthing = 1;
}
I would have thought I could do something like this:
message = proto_pb2.OuterLayer()
message.InnerLayer.otherthing = "bar"
Now - this doesn't fail, but when I print the message after setting this, I do not see the contents, leading me to believe that it isn't working. For example if I set a parameter at the top level:
message.thing = "foo"
and then print this:
print(message)
I see:
"thing" : "foo"
… but not the next layer down's contents.
Any suggestions would be much appreciated.