For the moments bars represents a String with all the Bar ids with ‘;’ separator
like 6;5;9;15
class Foo(db.Model):
id = db.StringProperty(multiline=True)
name = db.StringProperty(multiline=True)
bars = db.TextProperty()
class Bar(db.Model):
id = db.StringProperty(multiline=True)
name = db.StringProperty(multiline=True)
What must I do to explicit Foo contains some bars in db?
And also how is going to look my :
f = Foo()
f.name= 'aName'
f.id = '3615'
f.bars = '6;5;9;15'
f.put()
For a start, you never want to store multiple values inside a single textfield. AppEngine’s datastore supports multi-valued properties (such as
ListProperty): you should use those.That said, there’s no multi-valued equivalent of
ReferencePropertybuilt in. This article on the AppEngine documentation site gives a good example of how to model a list of keys.