[Zope-dev] RE: Catalog

Michel Pelletier michel@digicool.com
Fri, 9 Jul 1999 17:37:57 -0400


> -----Original Message-----
> From: Jason Spisak [mailto:webmaster@mtear.com]
> Sent: Friday, July 09, 1999 2:35 PM
> To: Michel Pelletier
> Subject: Re: Catalog
> 
> 
> Michel,
> 
> Sorry about the mail address.  We are bringing a new system up while
> simultaneously using another.  I sent the traceback from the 
> one that is
> being worked on. I think I have it, but I get this traceback about a
> sequence index must be an integer.  I have cleared the 
> Catalog and only
> know about Textindex and Fieldindex so the sequence must be internal.
> 
> Here's the code and here's what I get:
> 

A sequence index must be an integer error comes from Python, it has
nothing to do with the Indexing machinery in Zope.  The problem is
because your using manage_catalogObject, which needs a REQUEST object to
return to manage_main when it's done.  I would suggest:

<!--#call "Catalog.manage_catalogObject(REQUEST, [DestinationURL() + 
> '/' + REQUEST['id'])]"-->

manage_catalogObject wants at least one argument which MUST be a REQUEST
object for it to work without failing (since the urls to index defaults
to None, calling manage_catalogObject with only one argument will not
catalog anything).  In the case of your code, it was interpreting the
URL you passed as the REQUEST object, which is why it broke.

also, the second argument is in brackets.  this is because it must be a
sequence.  This is probably the wrong approach, I would recommend using
the external method way to catalog your object, and using the
catalog_object method.

-Michel

> <!--#with "EmployeeClass.createInObjectManager(REQUEST['id'], 
> REQUEST)"-->
>        <!--#call "propertysheets.properties.manage_changeProperties(
>                   name=REQUEST['name'],
> 		  wagner_name=REQUEST['wagner_name'],
> 		  extension=REQUEST['extension'],
> 		  address=REQUEST['address']
> 		  )"-->
> 
> <!--#call "Catalog.manage_catalogObject(DestinationURL() + 
> '/' + REQUEST['id'])"-->
> 
> <!--#/with-->
> 
> 
> Traceback:
> 
>  <P>
>   <STRONG>Error Type: TypeError</STRONG><BR>
>   <STRONG>Error Value: sequence index must be integer</STRONG><BR> 
>   </P>
>  
>   <HR NOSHADE>
>  
>   <P>Troubleshooting Suggestions</P>
> 
>   <UL>
>     <LI>The URL may be incorrect.</LI>
>   <LI>The parameters passed to this resource may be incorrect.</LI>
>   <LI>A resource that this resource relies on may be 
> encountering an error.</LI>
>   </UL>
> 
>   <P>For more detailed information about the error, please
>   refer to the HTML source for this page.
>   </P>
> 
>   <P>If the error persists please contact the site maintainer.
>   Thank you for your patience.
>   </P>
> </TD></TR>
> </TABLE>
> 
> 
> </BODY></HTML>
> <!--
> Traceback (innermost last):
>   File 
> /home/mike_weltz/Zope/lib/python/ZPublisher/Publish.py, line 256,
> in publish_module
>   File 
> /home/mike_weltz/Zope/lib/python/ZPublisher/Publish.py, line 161,
> in publish
>   File /home/mike_weltz/Zope/lib/python/ZPublisher/mapply.py, 
> line 154,
> in mapply
>     (Object: EmployeeClass_add)
>   File 
> /home/mike_weltz/Zope/lib/python/ZPublisher/Publish.py, line 98,
> in call_object
>     (Object: EmployeeClass_add)
>   File /home/mike_weltz/Zope/lib/python/OFS/DTMLMethod.py, 
> line 150, in __call__
>     (Object: EmployeeClass_add)
>   File /home/mike_weltz/Zope/lib/python/OFS/DTMLMethod.py, 
> line 145, in __call__
>     (Object: EmployeeClass_add)
>   File /home/mike_weltz/Zope/lib/python/DocumentTemplate/DT_String.py,
> line 502, in __call__
>     (Object: EmployeeClass_add)
>   File /home/mike_weltz/Zope/lib/python/DocumentTemplate/DT_With.py,
> line 148, in render
>     (Object: 
> EmployeeClass.createInObjectManager(REQUEST['id'], REQUEST))
>   File /home/mike_weltz/Zope/lib/python/DocumentTemplate/DT_Util.py,
> line 315, in eval
>     (Object: Catalog.manage_catalogObject(DestinationURL() + 
> '/' + REQUEST['id']))
>   File &lt;string&gt;, line 0, in ?
>   File /home/mike_weltz/Zope/lib/python/Products/ZCatalog/ZCatalog.py,
> line 216, in manage_catalogObject
>     (Object: Catalog)
>   File /home/mike_weltz/Zope/lib/python/App/special_dtml.py, line 120,
> in __call__
>     (Object: manage_main)
>   File /home/mike_weltz/Zope/lib/python/DocumentTemplate/DT_String.py,
> line 502, in __call__
>     (Object: manage_main)
>   File /home/mike_weltz/Zope/lib/python/App/special_dtml.py, line 120,
> in __call__
>     (Object: manage_tabs)
>   File /home/mike_weltz/Zope/lib/python/DocumentTemplate/DT_String.py,
> line 502, in __call__
>     (Object: manage_tabs)
>   File /home/mike_weltz/Zope/lib/python/DocumentTemplate/DT_With.py,
> line 133, in render
>     (Object: _(manage_options=filtered_manage_options()))
>   File /home/mike_weltz/Zope/lib/python/DocumentTemplate/DT_Util.py,
> line 309, in eval
>     (Object: _(manage_options=filtered_manage_options()))
> TypeError: (see above)
> 
> -->
> 
> 
> I think that the above should work, and I don't have and extra indexes
> or mate_date tables added, just the default.
> 
> Thanks again!
> 
> -- 
> Jason Spisak
> webmaster@mtear.com
>