Package s3 :: Module s3widgets :: Class S3XMLContents
[frames] | no frames]

Class S3XMLContents

source code

object --+
         |
        S3XMLContents


Renderer for db-stored XML contents (e.g. CMS)

Replaces {{page}} expressions inside the contents with local URLs.

{{page}}                 - gives the URL of the current page
{{name:example}}         - gives the URL of the current page with
                           a query ?name=example (can add any number
                           of query variables)
{{c:org,f:organisation}} - c and f tokens override controller and
                           function of the current page, in this
                           example like /org/organisation
{{args:arg,arg}}         - override the current request's URL args
                           (this should come last in the expression)
{{noargs}}               - strip all URL args

@note: does not check permissions for the result URLs

Instance Methods
 
__init__(self, contents)
Constructor
source code
 
link(self, match)
Replace {{}} expressions with local URLs, with the ability to override controller, function and URL query variables.Called from re.sub.
source code
 
xml(self)
Render the output
source code

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, contents)
(Constructor)

source code 

Constructor

Parameters:
  • contents - the contents (string)
Overrides: object.__init__

link(self, match)

source code 

Replace {{}} expressions with local URLs, with the ability to override controller, function and URL query variables.Called from re.sub.

Parameters:
  • match - the re match object

xml(self)

source code 

Render the output