[Zope-dev] ZClass Meta Types

Michel Pelletier michel@digicool.com
Tue, 13 Jul 1999 16:10:51 -0400


> -----Original Message-----
> From: Jason Spisak [mailto:webmaster@mtear.com]
> Sent: Tuesday, July 13, 1999 4:52 PM
> To: Michel Pelletier
> Cc: zope-dev@zope.org
> Subject: Re: [Zope-dev] ZClass Meta Types
> 
> 
> > 
> > Jim checked in a change this morning that should fix this.
> > 
> > -Michel
> > 
> 
> Michel,
> 
> I did a CVS update at 9 am or so PST and whe I changes the meta-type
> inside the ZClass, it still doesn't change in the add list, or t he
> SubObjects list. Do I need to give it another go? 
> 

I'll look into this:

> Also, I was wondering if you got my last mail about the Catalog not
> indexing the objects (Or adding them to the catalog at all) 
> unless I use
> the "Find Items to Catalog" tab.  I have tried the DTML route, but you
> had said that would not be as efficient so (and it did work 
> :).  I'm now
> using an external method called index_object, drawn verbatim from the
> mail you sent.  
> 
> def index_object
>     try: self.Catalog.catalog_object(self,self.url())
>     except: pass
> 

Ah I neglected to mention that your Findable class needs to define the
url method. ;)  It should be an external method, just like index_object:

def url(self, ftype=urllib.splittype, fhost=urllib.splithost):
    """Return a SCRIPT_NAME-based url for an object."""
    if hasattr(self, 'DestinationURL') and \
       callable(self.DestinationURL):
        url='%s/%s' % (self.DestinationURL(), self.id)
    else: url=self.absolute_url()
    type, uri=ftype(url)
    host, uri=fhost(uri)
    script_name=self.REQUEST['SCRIPT_NAME']
    __traceback_info__=(`uri`, `script_name`)
    if script_name:
        uri=filter(None, string.split(uri, script_name))[0]
    uri=uri or '/'
    if uri[0]=='/': uri=uri[1:]
    return uri

> I use that external method in the add constructor of the ZClass,
> 
> 
> <!--#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 index_object-->
> 
> <!--#/with-->
> 
> It creates the object, but does not add it to the catalog.  
> Is this a bug?
> 
> All my best,
> 
> Jason Spisak
> webmaster@mtear.com
>