0

I have a GroupWallet model where I want to store how much money several persons have. This information consist of the person, the persons key and the amount. So you could say I would like to save a list of tuples

[(Joe, JoeKey, 34),
 (Beth,BethKey,65)]

I've tried having a relational object (between GroupWallet and Person) but that did not scale very well.

I've been thinking of having three parallel lists, e.g. Names, NameKeys, Amount and use indexes to link the tuples together. But I don't like that solution and ran over NDB and StructuredProperty who does this in a nice way! But I also need PolyModel which does not exist in NDB, only in the original db library.

So my question is; does anybody know an independent StructuredProperty implementation or know if PolyModel will be implemented in NDB anytime soon?

Brent Washburne
  • 12,904
  • 4
  • 60
  • 82
thejaz
  • 2,763
  • 2
  • 26
  • 40
  • I'm implementing a [sync protocol](http://stackoverflow.com/questions/5035132/how-to-sync-iphone-core-data-with-web-server-and-then-push-to-other-devices/5052208#5052208) where entity types (tables) that are being synced share som common information. For example a timestamp which makes it possible for me to do 1 query for the PolyModel parent type and get all entities that should be synced instead of doing one query per entity type. Do you have any other suggestion how to solve it in App Engine? – thejaz Nov 28 '11 at 14:54
  • If the only things the entities have in common is the synchronization information, you should store them as regular kinds. Polymodel adds some overhead for every entity. – Nick Johnson Dec 04 '11 at 03:59
  • Yes, but you're paying for that with every single write. If reads of this sort are uncommon compared to writes, you should probably do the work at read time. – Nick Johnson Jan 24 '12 at 20:53

1 Answers1

0

PolyModel now exists in NDB, as of version 0.94.

http://code.google.com/p/appengine-ndb-experiment/downloads/detail?name=appengine-ndb-experiment-0.9.4.zip&can=2&q=

ehfeng
  • 3,807
  • 4
  • 33
  • 42