[Zope] Problems with Coding differences to do same
stuff...boundary="------------EAFFAD5A57052936695E91D7"
Felipe E Barousse Boue
fbarousse@piensa.com
Wed, 19 Jul 2000 20:48:22 -0500
This is a multi-part message in MIME format.
--------------8C513F1F766570D7029281D2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi, thanks for your comment !!
I know about not beeing allowed to access attributes that start with "_".
Actually what is intended here is for _[titulo] to be evaluated to the name
of a folder, the one that has just been created by the manage_addDTMLDocument
call (which worked fine)with the name specified by the user in a form field.
<dtml-call "company.noticias.manage_addDTMLDocument(titulo,subtitulo,texto)">
<dtml-with "company.noticias._[titulo]">
<dtml-call "propertysheets.manage_addProperty('link',resumen,'text')" >
</dtml-with>
The variable "titulo" comes from a form that calls itself so, I expected
company.noticias._[titulo] to be evaluated say as "company.noticias.january"
assuming the user entered "january" on the form.
Nevertheless, on my alternative coding, _[titulo] evaluated correctly, it's a
pity such a large coding had to be made, even introducing an "un-necesary"
loop-search and an "if" test, to accomplish what seemed trivial the way I
exposed in the first place...unless I am missing something.....
<dtml-call "company.noticias.manage_addDTMLDocument(titulo,subtitulo,texto)">
<dtml-with "company.noticias">
<dtml-in objectValues>
<dtml-in propertyValues>
<dtml-if "id() == _[titulo]">
<dtml-with id>
<dtml-call "propertysheets.manage_addProperty('link',resumen,'text')"
>
</dtml-with>
</dtml-if>
Any comments.? Thanks and regards.
Felipe Barousse
Dieter Maurer wrote:
> > Trying to do a simple thing as creating a document and then adding a
> > property with an DTML method, found that the following code does not
> > work, it comes up with a password request (all security settings are at
> > defaults):
> >
> > <dtml-call
> > "company.noticias.manage_addDTMLDocument(titulo,subtitulo,texto)">
> > <dtml-with "company.noticias._[titulo]">
> > <dtml-call
> > "propertysheets.manage_addProperty('link',resumen,'text')" >
> > </dtml-with>
>
> Try
> <dtml-with "_.getattr(company.noticias,_[titulo])">
>
> In DTML, you are not allowed to access any attribute
> starting with "_".
> And in fact, "_" is not even an attribute of "company.noticias".
>
> Dieter
--------------8C513F1F766570D7029281D2
Content-Type: text/x-vcard; charset=us-ascii;
name="fbarousse.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Felipe E Barousse Boue
Content-Disposition: attachment;
filename="fbarousse.vcf"
begin:vcard
n:Barousse Boué;Felipe E.
tel;fax:+(52)5247-0272
tel;work:+(52)5247-0272
x-mozilla-html:FALSE
url:http://www.piensa.com/
org:Bufete Consultor de Mexico - Piensa Systems;Supercomputer Cluster Systems group
version:2.1
email;internet:fbarousse@piensa.com
title:CEO, Director General
note:Tel: +(52)5247-0272
adr;quoted-printable:;;Ap. CAP Polanco 336=0D=0ACol. Anzures;Mexico City;D.F.;11550;Mexico
x-mozilla-cpt:;-27680
fn:Felipe E. Barousse Boué
end:vcard
--------------8C513F1F766570D7029281D2--