That works! Thank you
Phil Mayers escribió:
On Fri, 2007-07-06 at 11:15 +0200, Daniel de la Cuesta wrote:
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?
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
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
--
Daniel de la Cuesta Navarrete
Técnico
de Desarrollo de Software
FUNDACIÓN IAVANTE
[EMAIL PROTECTED]
Tel. 951 015
300
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.
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.
|
_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web