[Zope] dtml-method problem
Joachim Schmitz
perry@ac-copy.net
Fri, 27 Aug 1999 22:12:20 +0200 (CEST)
in my effort to create a general forms-product I am making progress.
I have now a dtml-method, where I just can add, modify, delete and
search database tables, the layout and logig is defined in a tinytable
called EinAusgabe. basically the stukture of the dtml-method bearbeiten
is:
<!--#unless expr="_vars.has_key('go')" -->
<!--#call "REQUEST.set('go','none')" -->
<!--#/unless -->
<!-------------------- add --------------------- -->
<!--#if expr="go == add" -->
<!--#in EinAusgabe -->
<!--#if expr="auto" -->
<!--#if expr="auto=='max'" -->
<!--#call "REQUEST.set('name',name)" -->
<!--#call "REQUEST.set('table',PARENTS[0].id)" -->
<!--#in maxvalue -->
<!--#call "REQUEST.set(name,_vars['sequence-key'] + 1)" -->
<!--#/in -->
<!--#/if -->
<!--#/if -->
<!--#/in -->
<!--#call "REQUEST.set('table',PARENTS[0].id)" -->
<!--#with "PARENTS[0]" -->
<!--#call "insert(REQUEST)" -->
<!--#/with -->
<!---------------------- Form-------------------->
<FORM ACTION="bearbeiten" METHOD=POST>
<table width="80%">
<!--#in EinAusgabe -->
<TR><TD valign=top width=15% bgcolor="#9cd6ff">
<FONT FACE="ARIAL, HELVETICA" SIZE="+0">
<!--#var label -->
</FONT></TD>
<TD valign=top width=85% bgcolor="#def7ff">
<!-- var "auto" -->
<!-- if "0" -->
<!--#if "_.string.find(auto,'link') > -1" -->
<!--#call "REQUEST.set('table',_.string.split(auto,',')[1])" -->
<!--#in selectall -->
<!--#if sequence-start -->
<SELECT NAME="<!--#var name -->">
<!--#/if -->
<option value="<!--#var "_[name]" -->"><!--#var "_[name]"
--></option>
<!--#/in -->
</select>
<!--#else -->
<INPUT TYPE=TEXT SIZE="<!--#var length -->" NAME=<!--#var name -->
value="<!--#var default-->">
<!--#/if -->
</TD></TR>
<!--#/in -->
</table>
<center>
<SELECT NAME="scol">
<!--#in EinAusgabe -->
<option <!--#if sequence-start --> selected <!--#/if -->
value="<!--#var name -->"><!--#var label --></option>
<!--#/in -->
</SELECT>
</center>
<!---------------abschicken------------------------------------------->
<center>
<INPUT TYPE=SUBMIT Name = "go" VALUE="<!--#var search -->">
<INPUT TYPE=SUBMIT Name = "go" VALUE="<!--#var change -->">
<INPUT TYPE=SUBMIT Name = "go" VALUE="<!--#var add -->">
<INPUT TYPE=SUBMIT Name = "go" VALUE="<!--#var add -->">
<INPUT TYPE=SUBMIT Name = "go" VALUE="<!--#var remove -->">
</center>
</form>
<!----------------------end Form-------------------->
<!--#/if -->
<!-------------------- change --------------------- -->
<!--#if expr="go == change" -->
<!--#call "REQUEST.set('table',PARENTS[0].id)" -->
<!--#var "update(REQUEST)" -->
<!---------------------- Form-------------------->
the same as above
<!----------------------end Form-------------------->
<!-------------------- search ----------------------->
<!--#if expr="go == search or go == next" -->
<snipp>
<!---------------------- Form-------------------->
the same as above
<!----------------------end Form-------------------->
so I thought to put the Form-things into it´s own dtml-method "beaform"
and called it so:
<!--#call "beaform(REQUEST,EinAusgabe=EinAusgabe,selectall=selectall)" -->
after that change, when I invoke it like this:
"z.z.de:8080/XY/abc/table/bearbeiten"
The authorisationdialog !!! pops up again, and I´m not able to log in,
after canceling the dialog the error message says:
Zope Error
Zope has encountered an error while publishing this resource.
Unauthorized
You are not authorized to access veran_id
where veran_id is a columname of the table I am accessing.
Is this a bug ?
Gruß
Joachim Schmitz
WWW-Consultant
email: js@ac-copy.net
tel: +49-241-89491-0
fax: +49-241-89491-29