Hi.
I'm replacing Kid with Genshi in my TG project.

but it not work in a form template. Can I use that?

The code:

=== controllers ===

class MyCamposBus(WidgetsList):
    ruta=TextField(label="Ruta",attrs=dict(size=10,max=10))
    cuenta=TextField(label="Cuenta",attrs=dict(size=6,max=6))
    nombre=TextField(label="Nombre",attrs=dict(size=10,max=15))

class MyFormBus(TableForm):
    fields = MyCamposBus()
    template = "agua.templates.usuarios.formbus"
    submit_text="Buscar usuario"
    name='buscar'
    action="/usuarios/buscar"

formBus = MyFormBus()

=== kid template formbus.kid  ===
<form xmlns:py="http://purl.org/kid/ns#";
name="${name}" action="${action}" method="${method}" class="form2"
py:attrs="form_attrs">
        <table>
        <tr>
        <td>${field_for('nombre').label}
        ${field_for('nombre').error}</td>
        <td>${display_field_for('nombre')}</td>

...


New Genshi template


=== genshi template formbus.html ===
<form xmlns="http://www.w3.org/1999/xhtml";
    xmlns:py="http://genshi.edgewall.org/";
    xmlns:xi="http://www.w3.org/2001/XInclude";
    name="${name}" id="id_form" action="${action}" method="${method}"
 class="form2"
    py:attrs="form_attrs"
    >

<table>
   <tr>
   <td>${field_for('nombre').label}
   ${field_for('nombre').error}</td>
   <td>${display_field_for('nombre')}</td>
...

I call it by the genshi template:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";
      xmlns:py="http://genshi.edgewall.org/";
      xmlns:xi="http://www.w3.org/2001/XInclude";>
<xi:include href="../master.html" />
...
<div id="idform" >
  ${ET(formbus.display())}
...

and the error:

  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b1-py2.4.egg/turbogears/widgets/forms.py",
line 220, in display
    return super(InputWidget, self).display(value, **params)
  File
"/usr/lib/python2.4/site-packages/TurboGears-1.0b1-py2.4.egg/turbogears/widgets/base.py",
line 226, in display
    return view.engines.get('kid').transform(params, self.template_c)
  File
"/usr/lib/python2.4/site-packages/TurboKid-0.9.8-py2.4.egg/turbokid/kidsupport.py",
line 162, in transform
    tclass = self.load_template(template)
  File
"/usr/lib/python2.4/site-packages/TurboKid-0.9.8-py2.4.egg/turbokid/kidsupport.py",
line 110, in load_template
    mod = _compile_template(package, basename, tfile, classname)
  File
"/usr/lib/python2.4/site-packages/TurboKid-0.9.8-py2.4.egg/turbokid/kidsupport.py",
line 14, in _compile_template
    mod = kid.load_template(tfile, name=classname)
  File
"/usr/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/__init__.py",
line 112, in load_template
    raise Exception, "Template not found: %s (in %s)" % (
Exception: Template not found:
/home/marcelo/workspace/geinsa/agua/templates/usuarios/formbus.kid

Have anyone any pointers to solve the problem?
Thanks.

-- 
maram
http://maram.com.ar - http://geine.maram.com.ar
Ubuntu Linux User - TurboGears User


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to