This is why I said "use repoze.bfg.jinja2".. Chameleon text templates have no looping constructs and using Chameleon ZPT templates to produce anything except XML is madness.
On 2/11/10 8:17 PM, Miuler wrote: > Mi class: > > class csv_view(object): > def __init__(self, context, request): > self.context = context > self. request = request > def __call__(self): > return {'items': [1,2,3,4,5,6]} > > > hello, I'm trying this but fails: > > =============================================== > test.csv.txt > =============================================== > > #---------------------------------------------- > #*GENSHI* > ${items} (OK) > {% for item in items %}\ (NO WORKING) > * ${item} (ERROR - no existe item) > {% end %} (NO WORKING) > #---------------------------------------------- > > #---------------------------------------------- > #*TAL* > <span tal:replace="" /> (NO WORKING) > #---------------------------------------------- > > > Why? > > > > 2010/2/11 Tres Seaver <tsea...@palladion.com > <mailto:tsea...@palladion.com>>: > > -----BEGIN PGP SIGNED MESSAGE----- > > Hash: SHA1 > > > > Miuler wrote: > >> ok thanks, but what is the syntax chameleton_text? url? > > > > I mis-typed, thinking that I remembered a module named 'chameleon.text'. > > In BFG, you can use the 'repoze.bfg.chameleon_text' helpers, e.g.: > > > > from repoze.bfg.chamedeon_text import render_template_to_response > > > > def my_view(context, request): > > return render_template_to_response('templates/my_view.txt', > > foo='Foo', > > ... > > ) > > > > See: > > > > > http://docs.repoze.org/bfg/1.2/api/chameleon_text.html?highlight=chameleon_text#module-repoze.bfg.chameleon_text > > > > > > > > > > Tres. > > - -- > > =================================================================== > > Tres Seaver +1 540-429-0999 tsea...@palladion.com > <mailto:tsea...@palladion.com> > > Palladion Software "Excellence by Design" http://palladion.com > > -----BEGIN PGP SIGNATURE----- > > Version: GnuPG v1.4.9 (GNU/Linux) > > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > > > iEYEARECAAYFAkt0msEACgkQ+gerLs4ltQ50/gCgz6ANNYwriRynuK+YSShbDsxh > > bBYAnihvaSwmdZeRu6WwI8k3cLOvBc0o > > =/VyH > > -----END PGP SIGNATURE----- > > > > > > _______________________________________________ > Repoze-dev mailing list > Repoze-dev@lists.repoze.org > http://lists.repoze.org/listinfo/repoze-dev -- Chris McDonough Agendaless Consulting, Fredericksburg VA The repoze.bfg Web Application Framework Book: http://bfg.repoze.org/book _______________________________________________ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev