Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Unable to locate object by ID

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


dlapointe at srs

May 19, 2004, 9:52 AM

Post #1 of 2 (569 views)
Permalink
Unable to locate object by ID

I'm a fairly experienced programmer/admin, but relatively new to zope (have
been forced to pick it up to manage a legacy system written in v 2.3). I'm
having a very confusing problem. Essentially I have some dtml code which is
used to remove certain objects. The code is as follows:



<dtml-var manage_page_header>

<dtml-var manage_tabs>

<h2><dtml-var document_title></h2>

<dtml-call "_.getitem('lhCatalog').uncatalog_object(REQUEST['hoursid'])">



<dtml-call "manage_delObjects(REQUEST['hoursid'],REQUEST)">

Hours entry has been removed.

<dtml-var manage_page_footer>



When pages are rendered, they look in the catalog and find the object fine.
When I call this method, however, it tells me the objects do not exist
(using what appears to be the same id). Is it possible that there are two
versions of the catalog, or that the catalog is caching objects in some way?



Any help on where to start debuggin this is much appreciated. (I'm using
v2.4).


pw_lists at slinkp

May 19, 2004, 12:43 PM

Post #2 of 2 (580 views)
Permalink
Re: Unable to locate object by ID [In reply to]

On Wed, May 19, 2004 at 12:52:21PM -0400, Lapointe, David wrote:
> I'm a fairly experienced programmer/admin, but relatively new to zope (have
> been forced to pick it up to manage a legacy system written in v 2.3). I'm
> having a very confusing problem. Essentially I have some dtml code which is
> used to remove certain objects. The code is as follows:
>
>
>
> <dtml-var manage_page_header>
>
> <dtml-var manage_tabs>
>
> <h2><dtml-var document_title></h2>
>
> <dtml-call "_.getitem('lhCatalog').uncatalog_object(REQUEST['hoursid'])">

I think the arg to uncatalog_object() needs to be a full path,
not just an id.

e.g. something like (untested)

<dtml-let catalog="_.getitem('lhCatalog')"
path="'/'.join(_.getitem(REQUEST['hoursid']).getPhysicalPath())">
<dtml-call "catalog.uncatalog_object(path)">

</dtml-let>

... assuming the objects in question are in the current folder.

--

Paul Winkler
http://www.slinkp.com

_______________________________________________
Zope maillist - Zope [at] zope
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.