<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
That works! Thank you<br>
<br>
Phil Mayers escribió:
<blockquote cite="mid1183717331.3293.29.camel@localhost.localdomain"
type="cite">
<pre wrap="">On Fri, 2007-07-06 at 11:15 +0200, Daniel de la Cuesta wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Following your instructions I have done:
<select>
<div nevow:render="formats">
<option nevow:pattern="option">
<nevow:attr name="value"><nevow:slot
name="value" /></nevow:attr>
<nevow:slot name="label" />
</option>
</div>
</select>
On the other side I have:
def render_formats(self, ctx, data):
for k,v in mydict.iteritems():
pattern.fillSlots('value', v).fillSlots('label', k)
But I cannot acces the pattern variable, what am I doing wrong?
</pre>
</blockquote>
<pre wrap=""><!---->
do this:
the_div = ctx.tag
# when called, this will return option tags
option_generator = the_div.patternGenerator('option')
for k,v in mydict.items():
# man an option tag
an_option = option_generator()
# set the variables
an_option.fillSlots('value', v).fillSlots('label', k)
# put it inside the div
the_div[an_option]
return the_div
HTH
_______________________________________________
Twisted-web mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Twisted-web@twistedmatrix.com">Twisted-web@twistedmatrix.com</a>
<a class="moz-txt-link-freetext" href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web</a>
</pre>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<title></title>
<p align="left"><span lang="es"><b><font color="#808080"
face="RotisSemiSans">Daniel de la Cuesta Navarrete</font></b></span> <br>
<span lang="es"><b><font color="#808080" face="RotisSemiSans">Técnico
de Desarrollo de Software</font></b></span></p>
<p align="left"><span lang="es"></span><span lang="es"><font
color="#339966" face="IAVANTE" size="4">FUNDACIÓN IAVANTE</font></span>
<br>
<span lang="es"><font color="#339966" face="RotisSemiSans"><a class="moz-txt-link-abbreviated" href="mailto:daniel.cuesta@iavantefundacion.com">daniel.cuesta@iavantefundacion.com</a></font></span>
<br>
<span lang="es"><font color="#339966" face="RotisSemiSans">Tel. 951 015
300</font></span> </p>
<br>
<p align="center"><span lang="es"><font color="#999999" face="Verdana"
size="1">Este correo electrónico y, en su caso, cualquier fichero
anexo, contiene información confidencial exclusivamente dirigida a
su(s) destinatario(s). Toda copia o divulgación deberá ser autorizada
por IAVANTE.</font></span></p>
<p align="center"><span lang="en-gb"><font color="#999999"
face="Verdana" size="1">This e-mail and any attachments are
confidential and exclusively directed to its adressee(s). Any copy or
distribution will have to be authorized by IAVANTE.</font></span></p>
<br>
</div>
</body>
</html>