[Zope] I _still_ need help on ZClasses and manage_clone

Heiko Stoermer Heiko Stoermer <heiko.stoermer@innominate.de>
Tue, 16 May 2000 18:36:19 +0200


Marco,

still I don't see why you would use an external method for the functions
below.
When I started zoping, I did far too much  in external methods because I
didn't know that DTML does it too.
My proposal: get my ListMate product and have a look at it. It does a
lot with manage_upload and the like.
It actually has _one_ external method, but all the rest is done in DTML
only.
Maybe this helps, because I think you have a structural problem in your
product.

greetings,
Heiko



Marco Mariani wrote:


> def NewArticolo(self,REQUEST,RESPONSE):
>     r=''
>     gruppo = REQUEST.form.get('gruppo')
> 
>     if gruppo:
>         next_art = self['prossimo_articolo']             # property of folder 'foto'
>         upload=self.upload.this()
>         id = 'art_%s'%next_art
> 
>         newob = upload.Control_Panel.Products.MArticolo.ArtClass(id)
>         newob.id = id
> #       newob.propertysheets.art_info.manage_changeProperties(REQUEST)
>         upload._setObject(id,newob)
> 
>     r=r+ 'Articolo %s aggiunto.<BR>' % next_art
>     next_art = next_art + 1
>     next_foto = self['prossima_foto']
> 
>     for i in gruppo:
> #       upload.manage_clone(upload[i],'foto_%s'%next_foto)
> #       ^^^^^^^ this works
> 
>         newob.manage_clone(upload[i],'foto_%s'%next_foto)
>         ^^^^^^^ this doesn't
> 
>         newob["foto_%s"%next_foto].manage_changeProperties({'filename': i})
>         r=r+ 'Foto %s aggiunta.<BR>' % i
>         next_foto = next_foto + 1
> 
>     self.manage_changeProperties({'prossimo_articolo': next_art})
>     self.manage_changeProperties({'prossima_foto': next_foto})
>     return r
> 

-- 
heiko.stoermer@innominate.de
                                                        innominate AG
                                                     networkingpeople
fon: +49.30.308806-0 fax: -77               web: http://innominate.de