The theObject.subCategories will just be a query object, you will need
to perform a fetch on it to get the values.

As far as I can tell, when you have a one to one relation, the
child.parent will return the parent object, if its a
ReferenceProperty.
But parent.child.fetch is needed..

On Oct 20, 8:39 am, Alex Vartan <[EMAIL PROTECTED]> wrote:
> get will only return a single object as far as I know. I want to fetch
> all of them. So must I use
> somelist = theObject.subCategories.fetch()
> or will somelist = [theObject.subCategories] work as well, explicitly
> assigning somelist as a list.
>
> On Oct 20, 9:33 am, djidjadji <[EMAIL PROTECTED]> wrote:
>
> > This should work, use get() from the Query object
>
> > somelist = theObject.subCategories.get()
> > somelist.remove(anotherObject)
>
> > 2008/10/20 Alex Vartan <[EMAIL PROTECTED]>:
>
> > > Hi,
>
> > > Simple question, but want to make sure I get this right. The docs say:
>
> > > "collection_name is the name of the property to give to the referenced
> > > model class whose value is a Query for all entities that reference the
> > > entity. If no collection_name is set, then modelname_set (with the
> > > name of the model in lowercase letters and "_set" added) is used."
>
> > > I've got code that reads like this in one of my classes:
>
> > >        parentCategory =
> > > db.SelfReferenceProperty(collection_name='subCategories')
>
> > > Then I need to make a copy of the resulting list, but remove an item
> > > for temporary processing:
>
> > > somelist = theObject.subCategories
> > > somelist.remove(anotherObject)
>
> > > WIll this work, without having to call a fetch? Since the docs make it
> > > seem like "theObject.subCategories" is actually an object of type
> > > Query.
> > > Thanks,
> > > Alex
--~--~---------~--~----~------------~-------~--~----~
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