Take the 2-minute tour ×

I would like to create a Group model in Google App Engine and then have an attribute where I can create a list of UserReferences. The documentation said:

"A property can have multiple values, represented in the datastore API as a Python list. The list can contain values of any of the value types supported by the datastore."

Would I implement this by creating:

class Group(db.Model): group_list = db.ListProperty(users.User)

Or might I be better served by simply listing the user entity keys?


share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

This depends on your use-case. If you already have a User model, to store additional data about your users, then using a db.ListProperty(Key) for User model keys is probably your best option.

share|improve this answer
add comment

keys are better placed in ReferenceProperty and their purpose is to create relationships between two kinds. You can simply create the listproperty and as your list grows keep adding listitems to it.

class Group(db.Model): 
  group_list = db.ListProperty()
share|improve this answer
add comment

Your Answer


