Back to index

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

List of all members.

Public Member Functions

def __init__
def get_rules

Public Attributes

 subdomain
 rules

Detailed Description

All URLs provided by this factory have the subdomain set to a
specific domain. For example if you want to use the subdomain for
the current language this can be a good setup::

    url_map = Map([
        Rule('/', endpoint='#select_language'),
        Subdomain('<string(length=2):lang_code>', [
            Rule('/', endpoint='index'),
            Rule('/about', endpoint='about'),
            Rule('/help', endpoint='help')
        ])
    ])

All the rules except for the ``'#select_language'`` endpoint will now
listen on a two letter long subdomain that helds the language code
for the current request.

Definition at line 228 of file routing.py.


Constructor & Destructor Documentation

def MoinMoin.support.werkzeug.routing.Subdomain.__init__ (   self,
  subdomain,
  rules 
)

Definition at line 247 of file routing.py.

00247 
00248     def __init__(self, subdomain, rules):
00249         self.subdomain = subdomain
00250         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 251 of file routing.py.

00251 
00252     def get_rules(self, map):
00253         for rulefactory in self.rules:
00254             for rule in rulefactory.get_rules(map):
00255                 rule.subdomain = self.subdomain
00256                 yield rule
00257 


Member Data Documentation

Definition at line 249 of file routing.py.

Definition at line 248 of file routing.py.


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