dodotable.environment — Environment for dodotable

Customize your table

Dodotable has dodotable.environment.Environment to render data to template and get a instance of sqlalchemy.orm.session.Session to requeset a query to database.

Usually dodotable.environment.Environment used in dodotable.schema.Schema. dodotable.schema.Schema.environment generate template loader and define custom function to Jinja’s environment to call a functions in template.

So, you have to inherit environment class and implement some methods,

A good example is dodotable.environment.flask.FlaskEnvironment. more examples are in it.

class dodotable.environment.Environment(locale_selector=None)

Top-level environment class, every environment class implemented by inherit this class.

Parameters:locale_selector (Callable) – a locale returning nullary function for selection of the right translation. the type of a return value can be str or babel.core.Locale as well. if it’s omitted or a return value is None English is shown.

Get custom template loader

Returns:jinja template loader
Return type:jinja2.loaders.BaseLoader