Skip to main content

UNKNOWN

Project description

About tgextodt

tgextodt is a Pluggable application for TurboGears2 that allows the rendering of .odt (openoffice/libreoffice) documents as an output templates.

Installing

tgextodt can be installed both from pypi or from bitbucket:

pip install tgextodt

should just work for most of the users

Plugging tgextodt

In your application config/app_cfg.py import plug:

from tgext.pluggable import plug

Then at the end of the file call plug with tgextodt:

plug(base_config, 'tgextodt')

Usage

To use an odt template you have to declare the type in your controller as below:

@expose('odt:example.templates.about', content_type='application/vnd.oasis.opendocument.text')
def about(self):
    return dict(hello='Hello World')

obviously in your example application in the folder example/templates you should provide a templated named about.odt in wich you have defined the variable field py3o.document.hello.

To define a variable field in libreoffice you can dig more information on https://help.libreoffice.org/Writer/Variables basically from the menu Insert -> Fields -> Other -> Variables

For more complex features, like for loops and more detailed reporting stuff, you want to read the documentation of the py3o library itself http://py3otemplate.readthedocs.org/

Now you can directly download your output from /about or /about.odt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tgext.odt-0.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file tgext.odt-0.1.tar.gz.

File metadata

  • Download URL: tgext.odt-0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for tgext.odt-0.1.tar.gz
Algorithm Hash digest
SHA256 7885474e3d830569ec93643c72d606875fb0bbc41438c5d69084abbe76dff4dd
MD5 fbdae6e0eb1b28b2c7f15a36a3631fc6
BLAKE2b-256 05081aa4ccb5cf62d327dd2f761b3e830f2ecfb18c422716a9dce23d596f405b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page