Thanks Andrew, I'll try it. Now I'm testing inside Zope and everything looks well, except for: self.cat.addIndex('id','FieldIndex' ) self.cat.addIndex('name' ,'FieldIndex' ) self.cat.addIndex('observaciones','FieldIndex' ) get_transaction().commit() Zope is telling me that from this version (2.6) I could not addIndex here, must be done outside(where?), in the Application (that I haven't). My problem is that I create the catalog inside the class class Authors: def __init__: .... if self.root.has_key( 'cat' ): self.cat= self.root['cat'] else: self.cat = Catalog() self.cat.aq_parent= self.root self.root['cat']= self.cat ### Here come the index I could not imagine where (and how) could make the indexes. I have seen a lot of documentation that makes references to addIndex... Thanks a lot again Emiliano.
Emiliano Marmonti wrote at 2003-9-17 22:51 -0300:
Thanks Andrew, I'll try it. Now I'm testing inside Zope and everything looks well, except for:
self.cat.addIndex('id','FieldIndex' ) self.cat.addIndex('name' ,'FieldIndex' ) self.cat.addIndex('observaciones','FieldIndex' ) get_transaction().commit()
Zope is telling me that from this version (2.6) I could not addIndex here, must be done outside(where?), in the Application (that I haven't). My problem is that I create the catalog inside the class
I have the feeling that you are working on a too low level. In Zope, you would usually work with a "ZCatalog" instance and not a "Catalog" instance. ZCatalog's "addIndex" has the signature you expect. "Catalog"'s "addIndex" has the signature "addIndex(name,indexObject)". See at "ZCatalog.addIndex" code to find out how to convert an index type into an index. Dieter
participants (2)
-
Dieter Maurer -
Emiliano Marmonti