Re: [protobuf] protobuf messages as repeated field?

2017-07-20 Thread Mingjian Lu
For anyone who might reach here for the same question. I suggest using extend instead of add and then give values to fields. For example: packetMessage.checkMessage.balanceUpdates.extend([balanceUpdateMessage]) This is much simpler and also easy for assigning object after deserialization and n

Re: [protobuf] protobuf messages as repeated field?

2013-06-24 Thread Lotte R. Leben
Hi Ilia, Am Montag, 24. Juni 2013 20:26:47 UTC+2 schrieb Ilia Mirkin: > > Try > > x = packetMessage.checkMessage.balanceUpdates.add() > x.tid = 111 > x.amount = 222 > works like a charm, thank you so much! > > See https://developers.google.com/protocol-buffers/docs/pythontutorial > for mo

Re: [protobuf] protobuf messages as repeated field?

2013-06-24 Thread Ilia Mirkin
Try x = packetMessage.checkMessage.balanceUpdates.add() x.tid = 111 x.amount = 222 See https://developers.google.com/protocol-buffers/docs/pythontutorial for more info. On Sun, Jun 23, 2013 at 9:49 AM, Lotte R. Leben wrote: > Hi, > this might be quite the newbie question, but I haven't been abl

[protobuf] protobuf messages as repeated field?

2013-06-24 Thread Lotte R. Leben
Hi, this might be quite the newbie question, but I haven't been able to find any hints through googling, so here it goes: What I'm trying to to is send orotobuf messages between an Android App a Python Script containing (among other things) a list of key-value pairs (if ints). The solution that