diff options
| author | Atsushi Odagiri <aodagx@gmail.com> | 2011-06-30 21:14:09 +0900 |
|---|---|---|
| committer | Atsushi Odagiri <aodagx@gmail.com> | 2011-07-03 03:12:04 +0900 |
| commit | 1c6fd879acaf2461c78263b2c21711c65ed668ed (patch) | |
| tree | d9baaf600441e12f6dbe88e971940f7fe227475b | |
| parent | da780fb9adbb5be06b8e2a115e04b0a533c90629 (diff) | |
| download | pyramid-1c6fd879acaf2461c78263b2c21711c65ed668ed.tar.gz pyramid-1c6fd879acaf2461c78263b2c21711c65ed668ed.tar.bz2 pyramid-1c6fd879acaf2461c78263b2c21711c65ed668ed.zip | |
use with includeme
| -rw-r--r-- | pyramid/config.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pyramid/config.py b/pyramid/config.py index 4143f5296..31cd44222 100644 --- a/pyramid/config.py +++ b/pyramid/config.py @@ -601,6 +601,7 @@ class Configurator(object): context.includepath = _context.includepath + (spec,) context.package = package_of(module) config = self.__class__.with_context(context) + config.root_route_name = self.root_route_name c(config) def with_root_route(self, route_name): @@ -1561,10 +1562,13 @@ class Configurator(object): root_route_name=route_name) return configurator - def mount(self, function, route_name): - function = self.maybe_dotted(function) + def mount(self, includeme, route_name): + """ mount subapplication on route named ``route_name``. + """ + config = self.with_root_route(route_name) - function(config) + config.include(includeme) + @action_method def add_route(self, |
