I have got the same error. And as you said, this error can be avoided
by renaming the Choice class to Choice1.

But it still confuse me: Poll still have a property name choice_set(as
long as choice1_set). Where the hell is choice_set come from?

On Apr 14, 11:47 am, Tim Hoffman <[email protected]> wrote:
> HI
>
> This won't be the datastore, at this point your not even trying to
> access it.
>
> Notice the reference to choice_set in the stacktrace.
>
> What you will find is that the BaseModel and django is possibly doing
> some metaclass work
> and/or the google code is (it generates accessors) is clashing.
>
> As an example if you have a reference_property pointing to a target
> class, the target class
> will get the an method automatically created for it called
> <source_class>_set
>
> You should rename the class Choice or the method choice and see which
> causes the error to go away
> (or burrow down into the code ;-)
>
> See ya
>
> T
>
> On Apr 13, 4:52 pm, Ferry Tanu <[email protected]> wrote:
>
> > Hi,
>
> > I'm trying to follow the google-app-engine-django sample, these are steps
> > that I did:
>
> > 1. models.py:
>
> > from appengine_django.models import BaseModel
> > from google.appengine.ext import db
>
> > class Poll(BaseModel):
> >     question = db.StringProperty()
> >     pub_date = db.DateTimeProperty('date published')
>
> > class Choice(BaseModel):
> >     poll = db.ReferenceProperty(Poll)
> >     choice = db.StringProperty()
> >     votes = db.IntegerProperty()
>
> > 2. python manage.py shell
> > 3. >>> from mysite.polls.models import Poll, Choice
>
> > Then got this error:
>
> > WARNING:root:Could not initialize images API; you are likely missing the
> > Python
> > "PIL" module. ImportError: No module named _imaging
> > Python 2.5.4 (r254
> > <http://code.google.com/p/google-app-engine-django/source/detail?r=254>:67916,
> > Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
> > (Intel)] on
> > win32
> > Type "help", "copyright", "credits" or "license" for more information.
> > (InteractiveConsole)>>> from mysite.polls.models import Poll, Choice
>
> > Traceback (most recent call last):
> >   File "<console>", line 1, in <module>
> >   File "D:\mysite\polls\models.py", line 9, in <module>
> >     class Choice(BaseModel):
> >   File "D:\mysite\appengine_django\models.py", line 131, in __init__
> >     super(PropertiedClassWithDjango, cls).__init__(name, bases, attrs)
> >   File "C:\Program
> > Files\Google\google_appengine\google\appengine\ext\db\__init_
> > _.py", line 319, in __init__
> >     _initialize_properties(cls, name, bases, dct)
> >   File "C:\Program
> > Files\Google\google_appengine\google\appengine\ext\db\__init_
> > _.py", line 270, in _initialize_properties
> >     attr.__property_config__(model_class, attr_name)
> >   File "C:\Program
> > Files\Google\google_appengine\google\appengine\ext\db\__init_
> > _.py", line 2546, in __property_config__
> >     self.collection_name))
> > DuplicatePropertyError: Class Model already has property choice_set
>
> > Anyone know why ?
>
> > Thanks
>
> > ~Ferry
--~--~---------~--~----~------------~-------~--~----~
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