[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope3-users
Subject:    [Zope3-Users] Adding indexes to a Catalog tool subclass
From:       td () yoma ! com ! au (Tom Dossis)
Date:       2005-09-28 18:12:52
Message-ID: 433B124C.4030808 () yoma ! com ! au
[Download RAW message or body]

Gary Poster wrote:
> 
> On Sep 28, 2005, at 1:53 AM, Tom Dossis wrote:
> 
>> I can add a tool which is a simple subclass of Catalog.
>> However if I try to add some index(es) in the constructor it fails  
>> with a NotYet error (see below).
>>
>> Is there a simple way to achieve this?
> 
> Yes.  Don't add the indexes with the constructor.  Add the catalog as  a 
> full utility first, as I described in my previous email, then start  
> adding indexes.

An interesting observation ..

1. Adding content into a container in the constructor does work...
2. Adding a Unique Id Utility will stop it working (NotYet error).

e.g.
class Contained(Persistent):
     implements(IContained)

class Container(BTreeContainer):
     implements(IContainer)
     def __init__(self):
         super(Container, self).__init__()
         self[u'small'] = Contained()
         self[u'medium'] = Contained()
         self[u'large'] = Contained()

Should this pattern be considered taboo in z3?

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic