ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> zope-List
zope-List
[Zope] Re: CatalogPathAwareness and manage_beforeDelete
by Maik Jablonski other posts by this author
Dec 17 2002 6:05PM messages near this date
Re: [Zope] CatalogPathAwareness and manage_beforeDelete | RE: [Zope] RE: Any comments from ex-PHP developers?
Bakhtiar A Hamid wrote:
>  hello all
>  i have a product that subclass CatalogPathAwareness and SimpleItem all works 
>  ok.  i,e an object instance will be added and deleted from the catalog
>  
>  however, if i override manage_beforeDelete, the catalog is not cleared when i 
>  delete the object instance
>  
>  is that natural?  do i have to supply my own uncatalog_object ?
>  
>  with this snippet, it still doesnt work.  i guess i don't get what uid for 
>  uncatalog_object is ...
>  
>  here's the snippet
>  
>          def manage_beforeDelete(self, item, container):
>                  """method for delete /cut/paste/rename"""
>                  img_dir = getattr(self.aq_parent, 'images')
>                  img_dir.manage_delObjects([item.getId()+'_image'])
>                  self.uncatalog_object(item.absolute_url(1))
>  

Hi,

just a guess: Maybe you should unindex your object first and then delete 
it... and another one: please try unindex_object instead of 
uncatalog_object:

          def manage_beforeDelete(self, item, container):
                  """method for delete /cut/paste/rename"""
                  img_dir = getattr(self.aq_parent, 'images')
                  self.unindex_object()
                  img_dir.manage_delObjects([item.getId()+'_image'])

-mj




_______________________________________________
Zope maillist  -  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 )
Thread:
Bakhtiar A Hamid
Dieter Maurer
Maik Jablonski

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved