I will start with the code:

class account(db.Model):
     users = db.ListProperty(db.UserProperty)

     def addUser(self, user):
          self.users.append(user)
          self.put()

This of course does not work, UserProperty cannot be uses with
ListProperty.  You must create some kind of shell to wrap around the
user property ala:

class UserShell(dbModel):
     def __init__(self, user):
          self.user = user
          self.user_id = user.user_id()
          self.email = user.email()

class Account(db.Model):
     users = db.ListProperty(db.Key)

     def addUser(self, userShell):
          self.users.append(userShell.key())
          self.put()

def main():
     user = users.get_current_user()
     userShell = UserShell(user)
     myAccount = Account()
     myAccount.addUser(userShell)

So essentially you have to make a duplicate of a user object, just so
you can manage a list of users in your application.
-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.


Reply via email to