[Zope] bug?

Jürgen Herrmann Juergen.Herrmann at XLhost.de
Wed Jul 6 07:03:03 EDT 2005


i was dumb :)

the metadata table simply didn't have getId, so the brains object
acquires getId from the catalog.

sorry for my nubness ;P

regards, juergen herrmann

[ Peter Bengtsson wrote:]
> Easy. The brain object doesn't have a 'getId()' method. The Catalog has.
> What you're probably after is something like this::
>
>  for brain in context.Catalog.searchResults({'bool':1}):
>       cataloged_object = brain.getObject()
>       if cataloged_object is None:
>           print "ZCatalog out of sync!!"
>       else:
>           print cataloged_object.getId()
>
> On 7/6/05, Jürgen Herrmann <Juergen.Herrmann at xlhost.de> wrote:
>> hi there!
>>
>> either this is a bug or i'm too stoned to see, what's going on...
>>
>> i have a folder /1, 2 subfolders /1/11 and /1/22. each subfolder
>> has a property 'bool', which is a boolean.
>> there's a zcatalog instance in /1/Catalog with one index bool, indexed
>> attribute 'bool'. i cataloged the two subfolders of /1 there.
>>
>> i have i skript /1/test with the following content:
>> results = context.Catalog.searchResults({'bool':1})
>> print results
>> for o in results:
>>   print o
>>   print o.getId
>>   print o.getId()
>> return printed
>>
>> it prints:
>> [<Products.ZCatalog.Catalog.mybrains object at 0xb629798c>,
>> <Products.ZCatalog.Catalog.mybrains object at 0xb40d9dec>]
>> <Products.ZCatalog.Catalog.mybrains object at 0xb629798c>
>> <bound method ZCatalog.getId of <ZCatalog at /1/Catalog>>
>> Catalog
>> <Products.ZCatalog.Catalog.mybrains object at 0xb40d9dec>
>> <bound method ZCatalog.getId of <ZCatalog at /1/Catalog>>
>> Catalog
>>
>> why in the world is o.getId a bound method of /1/Catalog?
>> o is a mybrains instance!!!
>>
>> what am i missing?! help!
>>
>> regards, juergen herrmann
>> _______________________________________________________________________
>>
>> >> XLhost.de - eXperts in Linux hosting <<
>>
>> Juergen Herrmann
>> Weiherweg 10, 93051 Regensburg, Germany
>> Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
>> Fax:  +49 (0)721 151 463027
>>
>> ICQ:  27139974  -  IRC: #XLhost at quakenet
>> WEB:  http://www.XLhost.de
>> _______________________________________________
>> Zope maillist  -  Zope at zope.org
>> http://mail.zope.org/mailman/listinfo/zope
>> **   No cross posts or HTML encoding!  **
>> (Related lists -
>>  http://mail.zope.org/mailman/listinfo/zope-announce
>>  http://mail.zope.org/mailman/listinfo/zope-dev )
>>
>
>
> --
> Peter Bengtsson,
> work www.fry-it.com
> home www.peterbe.com
> hobby www.issuetrackerproduct.com
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>


_______________________________________________________________________

>> XLhost.de - eXperts in Linux hosting <<

Juergen Herrmann
Weiherweg 10, 93051 Regensburg, Germany
Fon:  +49 (0)700 XLHOSTDE [0700 95467833]
Fax:  +49 (0)721 151 463027

ICQ:  27139974  -  IRC: #XLhost at quakenet
WEB:  http://www.XLhost.de


More information about the Zope mailing list