Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes
MoinMoin.support.werkzeug.routing.EndpointPrefix Class Reference
Inheritance diagram for MoinMoin.support.werkzeug.routing.EndpointPrefix:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.werkzeug.routing.EndpointPrefix:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def get_rules

Public Attributes

 prefix
 rules

Detailed Description

Prefixes all endpoints (which must be strings for this factory) with
another string. This can be useful for sub applications::

    url_map = Map([
        Rule('/', endpoint='index'),
        EndpointPrefix('blog/', [Submount('/blog', [
            Rule('/', endpoint='index'),
            Rule('/entry/<entry_slug>', endpoint='show')
        ])])
    ])

Definition at line 283 of file routing.py.


Constructor & Destructor Documentation

def MoinMoin.support.werkzeug.routing.EndpointPrefix.__init__ (   self,
  prefix,
  rules 
)

Definition at line 296 of file routing.py.

00296 
00297     def __init__(self, prefix, rules):
00298         self.prefix = prefix
00299         self.rules = rules


Member Function Documentation

Subclasses of `RuleFactory` have to override this method and return
an iterable of rules.

Reimplemented from MoinMoin.support.werkzeug.routing.RuleFactory.

Definition at line 300 of file routing.py.

00300 
00301     def get_rules(self, map):
00302         for rulefactory in self.rules:
00303             for rule in rulefactory.get_rules(map):
00304                 rule.endpoint = self.prefix + rule.endpoint
00305                 yield rule
00306 


Member Data Documentation

Definition at line 297 of file routing.py.

Definition at line 298 of file routing.py.


The documentation for this class was generated from the following file: