Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes Class Reference
Inheritance diagram for
Inheritance graph
Collaboration diagram for
Collaboration graph

List of all members.

Public Member Functions

def __init__
def get_rules

Public Attributes


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

Constructor & Destructor Documentation

def (   self,

Definition at line 247 of file

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

Definition at line 251 of file

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

Member Data Documentation

Definition at line 249 of file

Definition at line 248 of file

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