Hi Enrico,

this should work:

<embed src="${tg.url('/svg_graph', n=12)}" type="image/svg+xml">

Marko



Enrico schrieb:
> One last question on this thread though. If I try some param eg. n=12
>
>     <embed src="svg_graph?n=12" type="image/svg+xml">
>
>     def embed_svg(self):
>         return dict()
>
>     @expose(content_type=CUSTOM_CONTENT_TYPE)
>     def svg_graph(self, n):
>         response.headers["Content-type"] = "image/svg+xml"
>         g = Graph.Full(n, directed=False, loops=False)
>         etc.
>
> I get
> TypeError: svg_graph() takes exactly 2 arguments (1 given)
>
> If I try
> <embed src="svg_graph?self='self'&n=12" type="image/svg+xml">
> TemplateSyntaxError: not well-formed (invalid token)
>
> What's wrong? Bare ampersand illegal in XML so I try + or &amp;
> instead but that just gives an empty page.
>
> I also tried this:
> src="${tg.url('/svg_graph', self='self', n=12)}"
>
> Nothing works, I just get an empty page. So maybe tmpl_context, I
> was getting to that next but I can't even get n=12 to work. What is
> the best way to pass some parameters?
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "TurboGears" group.
> To post to this group, send email to [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/turbogears?hl=.
>
>
>   

--

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


Reply via email to