[Zope-dev] Calling Catalog from python script

richard@bizarsoftware.com.au richard@bizarsoftware.com.au
Thu, 15 Feb 2001 09:17:43 +1100


"R. David Murray" wrote:
> objs = []
> for catent in container.Catalog(context.REQUEST):
>   objs.append(container.Catalog.getobject(catent.data_record_id_))
> return objs
> 
> I've checked, and catent is a mybrains instance and catent.data_record_id_
> has an increasing number as its value.  So why doesn't this work?

Where did getobject come from? I know about Catalog.data, but I've never
seen a getobject() method...


> Also, and this is a better reason for posting this to zope-dev than
> asking for help is <grin>: why can't I say
> 
>   catent.getobject()
> 
> That would seem to be a lot more OOish.

I agree - I'm working with Catalog at the moment, and the whole brain thing
confuses the hell out of me :)


    Richard

-- 
Richard Jones
richard@bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)