How do I create a list of links in the Google App Engine datastore?

I have a type Fooin my Google App Engine datastore. I would like it to refer to a number of other types Foo, name them prerequisites.

I can use a type ListPropertyto create a list of simple value types, but I'm not sure how to do this with references. What is the recommended approach for this?

+3
source share
2 answers

There (now) is not db.ReferenceListPropertyin the data warehouse. You can get close to it with db.ListProperty(db.Key); if you need to get all the reference keys, you can make a package db.get()on it to immediately get all the related objects.

+7
source

Links are simply keys that can be represented as strings, so you can use StringListProperty to store your keys.

0
source

Source: https://habr.com/ru/post/1758967/


All Articles