<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hello, Roberto.<br><br>grok.index.Field and all IndexDefinition subclasses are actually just there for grokkers. The actual indexes are defined elsewhere. So to upgrade catalogs you should do:<br><br>cat = getUtility(ICatalog, 'my_catalog')<br>cat['new_attribute'] = grok.index.Field.index_class('new_attribute')<br>cat.updateIndexes()<br><br>Regards,<br><br>Danilo G. Botelho<br><br>--- On <b>Wed, 9/7/11, grok-dev-request@zope.org <i>&lt;grok-dev-request@zope.org&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: grok-dev-request@zope.org &lt;grok-dev-request@zope.org&gt;<br>Subject: Grok-dev Digest, Vol 60, Issue 1<br>To: grok-dev@zope.org<br>Date: Wednesday, September 7, 2011, 9:00 AM<br><br><div class="plainMail">Send Grok-dev mailing list submissions to<br>&nbsp;&nbsp;&nbsp; <a
 ymailto="mailto:grok-dev@zope.org" href="/mc/compose?to=grok-dev@zope.org">grok-dev@zope.org</a><br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>&nbsp;&nbsp;&nbsp; <a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br>or, via email, send a message with subject or body 'help' to<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:grok-dev-request@zope.org" href="/mc/compose?to=grok-dev-request@zope.org">grok-dev-request@zope.org</a><br><br>You can reach the person managing the list at<br>&nbsp;&nbsp;&nbsp; <a ymailto="mailto:grok-dev-owner@zope.org" href="/mc/compose?to=grok-dev-owner@zope.org">grok-dev-owner@zope.org</a><br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Grok-dev digest..."<br><br><br>Today's Topics:<br><br>&nbsp;&nbsp;&nbsp;1. Upgrading catalog utility (Roberto
 Allende)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 6 Sep 2011 14:28:53 -0300<br>From: Roberto Allende &lt;<a ymailto="mailto:rover@menttes.com" href="/mc/compose?to=rover@menttes.com">rover@menttes.com</a>&gt;<br>Subject: [Grok-dev] Upgrading catalog utility<br>To: <a ymailto="mailto:grok-dev@zope.org" href="/mc/compose?to=grok-dev@zope.org">grok-dev@zope.org</a><br>Message-ID:<br>&nbsp;&nbsp;&nbsp; &lt;CABZRKQQ2i-qcu0kNocS4YTK+zPjOKCn1-fNQ6+uoYp-yubHE=<a ymailto="mailto:Q@mail.gmail.com" href="/mc/compose?to=Q@mail.gmail.com">Q@mail.gmail.com</a>&gt;<br>Content-Type: text/plain; charset=ISO-8859-1<br><br>Hello<br><br>Short version:<br>How do i recreate, ie delete an create a new catalog for an existing<br>application ?.<br><br>Long Version:<br>I need to upgrate an applcation made with grok to a new version and i<br>need to add a new index to its catalog. Following the example at
 Grok<br>Documentation[1], let's say i've:<br><br>class SiteCatalog(grok.Indexes):<br>&nbsp; &nbsp; grok.site(Testvalueindex)<br>&nbsp; &nbsp; grok.context(MyObject)<br>&nbsp; &nbsp; grok.name('my_catalog')<br><br>&nbsp; &nbsp; counter = Value()<br><br>An my new catalog has a new attribute, called new_attribute:<br><br>class SiteCatalog(grok.Indexes):<br>&nbsp; &nbsp; grok.site(Testvalueindex)<br>&nbsp; &nbsp; grok.context(MyObject)<br>&nbsp; &nbsp; grok.name('my_catalog')<br><br>&nbsp; &nbsp; counter = Value()<br>&nbsp; &nbsp; new_attribute = grok.index.Field()<br><br>So, the problem is i've to re create SiteCatalog for my application<br>and "Source code for grok.index"[2] says&nbsp; "Note that, since index<br>creation (and thus a call to our :meth:`setup()` method) currently<br>occurs only during the creation of a new Grok `Application` object in<br>the Zope Database".<br><br>I tried to instantiate the index and they monkey patch, which it<br>wouldn't
 be the most elegant solution but it could solve the problem<br>runing an upgrade method just once and i got an "can only be<br>instantiated on class level" exception.<br><br>So... any suggestion is very appreciated.<br><br>Kind Regards<br>Roberto Allende<br><br>1. <a href="http://grok.zope.org/documentation/how-to/implementing-search/view" target="_blank">http://grok.zope.org/documentation/how-to/implementing-search/view</a><br>2. <a href="http://grok.zope.org/doc/dev/_modules/grok/index.html" target="_blank">http://grok.zope.org/doc/dev/_modules/grok/index.html</a><br><br><br>------------------------------<br><br>_______________________________________________<br>Grok-dev mailing list<br><a ymailto="mailto:Grok-dev@zope.org" href="/mc/compose?to=Grok-dev@zope.org">Grok-dev@zope.org</a><br><a href="https://mail.zope.org/mailman/listinfo/grok-dev" target="_blank">https://mail.zope.org/mailman/listinfo/grok-dev</a><br><br><br>End of Grok-dev Digest, Vol
 60, Issue 1<br>***************************************<br></div></blockquote></td></tr></table>