use it to wrap a string that contains XML/HTML so that it will not be
escaped by the template
example:
|
__init__(self,
text,
sanitize=True,
permitted_tags=[ ' a ' , ' b ' , ' blockquote ' , ' br/ ' , ' i ' , ' li ' , ' ol ' , ' ul ' , ' p ' , ' c ... ,
allowed_attributes={ ' a ' : [ ' href ' , ' title ' ] , ' blockquote ' : [ ' type ' ] , ' img ' : [ ' src ' ... )
:param text: the XML text
:param sanitize: sanitize text using the permitted tags and allowed
attributes (default False)
:param permitted_tags: list of permitted tags (default: simple list of
tags)
:param allowed_attributes: dictionary of allowed attributed (default
for A, IMG and BlockQuote). |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
flatten(self,
render=1)
return the text stored by the XML object rendered by the render
function |
source code
|
|
|
elements(self,
*args,
**kargs)
to be considered experimental since the behavior of this method is
questionable another options could be
TAG(self.text).elements(*args,**kargs) |
source code
|
|
Inherited from object :
__delattr__ ,
__getattribute__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__
|