ZCatalog & resource not found error
This python script: results = container.Catalog(meta_type='Broadcast', getStartTime=DateTime(), getStartTime_usage='range:min', sort_on='getStartTime') return results[0] produces this error when I click the 'Test' tab: Zope has encountered an error while publishing this resource. Resource not found Sorry, the requested Zope resource does not exist. Check the URL and try again. If I take the [0] part off and have it return the whole results list, I have no problems (it returns a list with two items). Weird. Any clues? (Zope 2.3.1 (binary release, python 1.5.2, win32-x86)) -- Tim Moore
The objects returned in the sequence returned from Catalog.searchResults are "brain" objects. These objects have no default representation. This may be what you're looking to do: results = container.Catalog(meta_type='Broadcast', getStartTime=DateTime(), getStartTime_usage='range:min', sort_on='getStartTime') result = results[0] return container.Catalog.getObject(result) Tim Moore wrote:
This python script:
>
return results[0]
produces this error when I click the 'Test' tab:
Zope has encountered an error while publishing this resource.
Resource not found
Sorry, the requested Zope resource does not exist. Check the URL and try again.
If I take the [0] part off and have it return the whole results list, I have no problems (it returns a list with two items). Weird.
Any clues? (Zope 2.3.1 (binary release, python 1.5.2, win32-x86)) -- Tim Moore
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (2)
-
Chris McDonough -
Tim Moore