Hi Marzia, heres everything i could think of that might be relevent:

[Edit Item -> ImgItem]:
ImgItem.gql('WHERE style = :style and merchant in :merchants ORDER BY
__key__',style=theStyle,merchants=merchantList)

class Item(BaseModel):
    name = db.StringProperty()
    cumulative_avg = db.FloatProperty()
    cumulative_count = db.IntegerProperty()

    def __eq__(self, other):
        if isinstance(other, Item):
            return self.key() == other.key()
    def __hash__(self):
        return self.key().__hash__()

class ImgItem(Item):
    imgurl = db.StringProperty()
    crawl=db.ReferenceProperty(Crawl)
    pic=db.ReferenceProperty(Picture,default=None)
    style=db.ReferenceProperty(Style)
    style_override=db.BooleanProperty()
    price=db.FloatProperty()
    link=db.LinkProperty()
    about = db.TextProperty()
    lastUpdate=db.DateTimeProperty(default=None)
    merchant = db.ReferenceProperty(Merchant)

class Merchant(BaseModel):
    name= db.StringProperty()

Thanks,

Paul.

On Jan 12, 3:05 pm, Marzia Niccolai <ma...@google.com> wrote:
> Hi,
>
> What is the model definition for Item?
>
> -Marzia
>
>
>
> On Mon, Jan 12, 2009 at 2:58 PM, Paul <pwid...@gmail.com> wrote:
>
> > Am i doing something crazy or should i report this as a bug?
>
> > On Jan 9, 6:45 pm, Paul <pwid...@gmail.com> wrote:
> >> I have a GQL query that works fine when theres only one Merchant
> >> Entity, but fails as below when theres more than 1, any ideas?
>
> >> merchantList= [e.key() for e in Merchant.all().fetch(10)]
>
> >> Item.gql('WHERE style = :style and merchant in :merchants ORDER BY
> >> __key__',style=theStyle,merchants=merchantList)
>
> >>   846.     entities = query.fetch(numItems)
> >> File "/home/paul/projects/outfitsis/.google_appengine/google/appengine/
> >> ext/db/__init__.py" in fetch
> >>   1377.     raw = self._get_query().Get(limit, offset)
> >> File "/home/paul/projects/outfitsis/.google_appengine/google/appengine/
> >> ext/db/__init__.py" in _get_query
> >>   1659.     return self._proto_query.Bind(self._args, self._kwds)
> >> File "/home/paul/projects/outfitsis/.google_appengine/google/appengine/
> >> ext/gql/__init__.py" in Bind
> >>   256.         query.update(enumerated_query)
> >> File "/home/paul/projects/outfitsis/.google_appengine/google/appengine/
> >> api/datastore.py" in update
> >>   1036.       self.__setitem__(filter, value)
> >> File "/home/paul/projects/outfitsis/.google_appengine/google/appengine/
> >> api/datastore.py" in __setitem__
> >>   979.     datastore_types.ValidateProperty(' ', value,
> >> read_only=True)
> >> File "/home/paul/projects/outfitsis/.google_appengine/google/appengine/
> >> api/datastore_types.py" in ValidateProperty
> >>   1066.           'Unsupported type for property %s: %s' % (name,
> >> v.__class__))
>
> >> Exception Type: BadValueError at /design/
> >> Exception Value: Unsupported type for property  : <class
> >> 'food.models.Merchant'>
>
> >> Running appengine_1.1.7
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to