Package Camelot :: Package camelot :: Package admin :: Package form_action :: Class DocxFormAction
[frames] | no frames]

Class DocxFormAction

source code


Action that generates a .docx file and opens it. It does so by generating an xml document with jinja templates that is a valid word document.
Instance Methods
 
__init__(self, name, icon=Icon('tango/16x16/mimetypes/x-office-document.png'))
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
get_context(self, obj)
Returns: a dictionary with objects to be used as context when jinja fills up the xml document
source code
 
get_environment(self, obj)
Return the jinja environment to be used to render the xml document
source code
 
get_template(self, obj)
Returns: the name of the jinja template for xml document
source code
 
document(self, obj)
Returns: the xml content of the document
source code
 
open_xml(self, obj) source code

Inherited from FormActionFromModelFunction: enabled, run

Inherited from FormAction: get_icon, get_name, render

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self, name, icon=Icon('tango/16x16/mimetypes/x-office-document.png'))
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Parameters:
  • name - the name of the action
  • model_function - a function that has 1 arguments : the object on which to apply the action
  • icon - an Icon
  • flush - flush the object to the db and refresh it in the views
  • enabled - a function that has 1 argument : the object on which the action would be applied
Overrides: object.__init__
(inherited documentation)

get_context(self, obj)

source code 
Returns:
a dictionary with objects to be used as context when jinja fills up the xml document

get_template(self, obj)

source code 
Returns:
the name of the jinja template for xml document

document(self, obj)

source code 
Returns:
the xml content of the document