HI ListProperty tan take basic properties as contained types, i.e. str, db.Key, Int, but not model objects (se ethe docs for the full list) See http://code.google.com/appengine/docs/python/datastore/typesandpropertyclasses.html and have a look at the value type of ListProperty
You are trying to put a model in the ListProperty, rather than than something that is an acceptable property or basic python tupe That list should be a list of keys I would think, (ie keys of PhoneInfo entities) Rgds T On Mar 21, 3:53 pm, Laran Evans <[email protected]> wrote: > I'm using the app-enging django helper > > Here are my models as defined in models.py. > > class PhoneInfo(BaseModel): > name = db.StringProperty() > phone = db.PhoneNumberProperty() > > class Person(BaseModel): > is_verified = db.BooleanProperty() > verification_token = db.StringProperty() > verified_at = db.DateTimeProperty() > first_name = db.StringProperty() > last_name = db.StringProperty() > email = db.EmailProperty() > hashed_password = db.StringProperty() > password_reset_token = db.StringProperty() > phone_numbers = db.ListProperty(PhoneInfo) > > When I load up the shel and simply try to import, I get a ValueError. > > >>> from laranevans.tracker.models import Person > > Traceback (most recent call last): > File "<console>", line 1, in <module> > File "/Users/laran/Workspace/laranevans/../laranevans/tracker/ > models.py", line 12, in <module> > class Person(BaseModel): > File "/Users/laran/Workspace/laranevans/../laranevans/tracker/ > models.py", line 21, in Person > phone_numbers = db.ListProperty(PhoneInfo) > File "/usr/local/google_appengine/google/appengine/ext/db/ > __init__.py", line 2362, in __init__ > raise ValueError('Item type %s is not acceptable' % > item_type.__name__) > ValueError: Item type PhoneInfo is not acceptable > > > > I'm sure it's something simple. I can't see it for the life of me > though. Any help would be very welcome. Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
