django

package module
v0.0.0-...-0cfad15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FilterExists returns true if the given filter is already registered.
	FilterExists = pongo2.FilterExists

	// RegisterFilter registers a new filter. If there's already a filter
	// with the same name, RegisterFilter will panic. You usually want
	// to call this function in the filter's init() function.
	RegisterFilter = pongo2.RegisterFilter

	// RegisterTag registers a new tag. You usually want to call this function
	// in the tag's init() function.
	RegisterTag = pongo2.RegisterTag

	// ReplaceFilter replaces an already registered filter with a new
	// implementation. Use this function with caution since it allows you
	// to change existing filter behaviour.
	ReplaceFilter = pongo2.ReplaceFilter

	// ReplaceTag replaces an already registered tag with a new implementation.
	// Use this function with caution since it allows you to change existing
	// tag behaviour.
	ReplaceTag = pongo2.ReplaceTag

	// SetAutoescape sets whether or not to escape automatically.
	SetAutoescape = pongo2.SetAutoescape
)

Some functions from pongo2.

Functions

This section is empty.

Types

type Context

type Context = pongo2.Context

A Context type provides constants, variables, instances or functions to a template.

type Engine

type Engine struct {
	*pongo2.TemplateSet
	// contains filtered or unexported fields
}

Engine adapts the pongo2 engine.

func New

func New(dir string, extension ...string) *Engine

New returns a new django engine.

func (*Engine) Execute

func (e *Engine) Execute(w io.Writer, filename string, data interface{}, metadata map[string]interface{}) error

Execute renders a django template.

func (*Engine) Ext

func (e *Engine) Ext() string

Ext returns the file extension which this django engine is responsible to render.

func (Engine) Load

func (e Engine) Load() error

Load reloads all the django templates.

type Error

type Error = pongo2.Error

The Error type is being used to address an error during lexing, parsing or execution.

type FilterFunction

type FilterFunction = pongo2.FilterFunction

FilterFunction is the type filter functions must fulfil.

type TagParser

type TagParser = pongo2.TagParser

TagParser is the function signature of the tag's parser you will have to implement in order to create a new tag.

type Template

type Template = pongo2.Template

Template is a template type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL