Back to index

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

List of all members.

Public Member Functions

def __init__
def get_rules

Public Attributes

 path
 rules

Detailed Description

Like `Subdomain` but prefixes the URL rule with a given string::

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

Now the rule ``'blog/show'`` matches ``/blog/entry/<entry_slug>``.

Definition at line 258 of file routing.py.


Constructor & Destructor Documentation

def MoinMoin.support.werkzeug.routing.Submount.__init__ (   self,
  path,
  rules 
)

Definition at line 272 of file routing.py.

00272 
00273     def __init__(self, path, rules):
00274         self.path = path.rstrip('/')
00275         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 276 of file routing.py.

00276 
00277     def get_rules(self, map):
00278         for rulefactory in self.rules:
00279             for rule in rulefactory.get_rules(map):
00280                 rule.rule = self.path + rule.rule
00281                 yield rule
00282 


Member Data Documentation

Definition at line 273 of file routing.py.

Definition at line 274 of file routing.py.


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