Re: How to make an action generate html?

"John P. Rouillard" <[email protected]> Wed, 14 Feb 2024 09:35:06 -0500
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
Hi Ralf:

In message <[email protected]>,
Ralf Schlatterbeck writes:
>On Tue, Feb 13, 2024 at 01:01:24PM -0500, John P. Rouillard wrote:
>> I am trying to find out how to return a templated page from an action.
>> My thought is that the page template would be something like:
>> 
>>    index.chart.html
>> 
>> and would be expanded/returned from the action with the action somehow
>> embedding an svg as the main content.
>
>I've done a similar thing: Return a picture (plotted with matplotlib)
>from an action. The idea is to simply return the contents from the
>handle() method.
>
>This is not 'templated' in that it doesn't use roundup's templating
>engine. But it is computed contents.
>
>Some code here:
>
>class Log_Status_Statistics (actions.Action, _Helper):
>
>    def handle (self, outfile = None):
>...

Thanks for the reply. What you showed is basically what I have. I get
an SVG drawn alone in the web browser. However I really want to wrap
that SVG in the icing of the page.html template so the chart looks
like it's part of the tracker.

However you might have given me an idea. I could create the class
inheriting from Action and the templating library. Then call the
templating library directly to generate the templated content.

Thoughts?

Have a great week.

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.