<div dir="ltr">Hi all,<br>Can anybody tell me how can i add resource by using <a href="http://z3c.pt">z3c.pt</a>. i know how to add it by using zope.pagetemplate, i tried it and it was working well. The following is the code i am working with and it was not working with <a href="http://z3c.pt">z3c.pt</a><br>
<br><br><b><u>configure.zcml:-<br><br></u>.<br>.<br></b><adapter<br> factory=".resizing_font.form_template"<br> for=".resizing_font.ResizingFont"<br> name="tatr_css_js.form"<br>
/> <b> <br><br> </b><browser:resourceDirectory<br> name="tatr_js"<br> directory="tatr_resource_js"<br> /> <b><br><br>.<br>.<br>.<br><br><br><u><a href="http://resizing_font.pt">resizing_font.pt</a> :-<br>
<br></u></b><html><b><u><br></u></b> <head><br> <script type="text/javascript" src="jquery-1.2.6.js"<br> tal:attributes="src context/++resource++tatr_js/jquery-1.2.6.js"> <br>
</script> <br> </head><br> <body><br> This is a test :)<br> </body><br><br></html><b><u><br><br><br><br>resizing_font.py :-<br><br></u></b>from z3c.pt.pagetemplate import ViewPageTemplateFile<b><u><br>
<br></u></b>class ResizingFont(FormBase): <br> template = NamedTemplate('tatr_css_js.form') <br> form_fields=[] <br> def __init__(self,context,request):<br> self.request=request <br>
self.context=context<br>form_template = NamedTemplateImplementation(<br> ViewPageTemplateFile('<a href="http://resizing_font.pt">resizing_font.pt</a>'))<br><br><br><b>While running with this code i am getting the error <br>
<br></b>2008-10-14T06:14:36 ERROR SiteError <a href="http://192.168.0.43:8080/resizing_font.html">http://192.168.0.43:8080/resizing_font.html</a><br>Traceback (most recent call last):<br> File "/home/z3.4/lib/python/zope/publisher/publish.py", line 133, in publish<br>
result = publication.callObject(request, obj)<br> File "/home/z3.4/lib/python/zope/app/publication/zopepublication.py", line 167, in callObject<br> return mapply(ob, request.getPositionalArguments(), request)<br>
File "/home/z3.4/lib/python/zope/publisher/publish.py", line 108, in mapply<br> return debug_call(obj, args)<br> - __traceback_info__: <security proxied zope.app.publisher.browser.viewmeta.ResizingFont instance at 0x98deeac><br>
File "/home/z3.4/lib/python/zope/publisher/publish.py", line 114, in debug_call<br> return obj(*args)<br> File "/home/z3.4/lib/python/zope/formlib/form.py", line 774, in __call__<br> return self.render()<br>
File "/home/z3.4/lib/python/zope/formlib/form.py", line 768, in render<br> self.form_result = self.template()<br> File "/home/z3.4/lib/python/z3c/pt/pagetemplate.py", line 40, in render<br> return template.render(**parameters)<br>
File "/home/z3.4/lib/python/chameleon/zpt/template.py", line 51, in render<br> return super(PageTemplateFile, self).render(**kwargs)<br> File "/home/z3.4/lib/python/chameleon/core/template.py", line 156, in render<br>
return super(TemplateFile, self).render(**kwargs)<br> File "/home/z3.4/lib/python/chameleon/core/template.py", line 62, in render<br> template = self.cook_check(parameters=kwargs)<br> File "/home/z3.4/lib/python/chameleon/core/template.py", line 152, in cook_check<br>
return Template.cook_check(self, **kwargs)<br> File "/home/z3.4/lib/python/chameleon/core/template.py", line 57, in cook_check<br> template = self.cook(parameters=parameters, **kwargs)<br> File "/home/z3.4/lib/python/chameleon/core/template.py", line 138, in cook<br>
template = self.compiler(**kwargs)<br> File "/home/z3.4/lib/python/chameleon/core/translation.py", line 597, in __call__<br> self.root.start(stream)<br> File "/home/z3.4/lib/python/chameleon/core/translation.py", line 438, in start self.node.visit()<br>
File "/home/z3.4/lib/python/chameleon/core/translation.py", line 107, in visit self.body()<br> File "/home/z3.4/lib/python/chameleon/core/translation.py", line 92, in body<br> element.node.visit()<br>
File "/home/z3.4/lib/python/chameleon/core/translation.py", line 107, in visit self.body()<br> File "/home/z3.4/lib/python/chameleon/core/translation.py", line 92, in body<br> element.node.visit()<br>
File "/home/z3.4/lib/python/chameleon/core/translation.py", line 107, in visit self.body()<br> File "/home/z3.4/lib/python/chameleon/core/translation.py", line 92, in body<br> element.node.visit()<br>
File "/home/z3.4/lib/python/chameleon/core/translation.py", line 106, in visit self.begin()<br> File "/home/z3.4/lib/python/chameleon/core/translation.py", line 72, in begin<br> self.stream.begin(self.serialize())<br>
File "/home/z3.4/lib/python/chameleon/core/translation.py", line 174, in serialize<br> dynamic_attrs = self.dynamic_attributes or ()<br> File "/home/z3.4/lib/python/chameleon/zpt/language.py", line 74, in dynamic_attributes<br>
if self.element.tal_attributes is not None:<br> File "/home/z3.4/lib/python/chameleon/core/utils.py", line 52, in get<br> return f(value)<br> File "/home/z3.4/lib/python/chameleon/zpt/expressions.py", line 236, in definitions<br>
raise e<br>SyntaxError: Not a valid path-expression.<br><a href="http://192.168.0.43">192.168.0.43</a> - - [14/Oct/2008:06:14:36 +0000] "GET /resizing_font.html HTTP/1.1" 500 84 "<a href="http://192.168.0.43:8080/">http://192.168.0.43:8080/</a>" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:<a href="http://1.8.1.16">1.8.1.16</a>) Gecko/20080702 Iceweasel/<a href="http://2.0.0.16">2.0.0.16</a> (Debian-2.0.0.16-0etch1)"<br>
<br><br>Thanks in advance :)<br><b><br> <br></b><br> <br></div>