diff options
| author | Chris McDonough <chrism@plope.com> | 2010-12-07 22:13:27 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-12-07 22:13:27 -0500 |
| commit | 18da3e8465dce7b47fdeed28f19af0ad81d482bd (patch) | |
| tree | 47854526314aeb60980ad7faf6d83270b246083d | |
| parent | d43e3f0acc31424bf2d52b6a0ef36950ec8ab4c2 (diff) | |
| download | pyramid-18da3e8465dce7b47fdeed28f19af0ad81d482bd.tar.gz pyramid-18da3e8465dce7b47fdeed28f19af0ad81d482bd.tar.bz2 pyramid-18da3e8465dce7b47fdeed28f19af0ad81d482bd.zip | |
move with_context to API
| -rw-r--r-- | pyramid/configuration.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pyramid/configuration.py b/pyramid/configuration.py index 8d9a3780d..a6b712d99 100644 --- a/pyramid/configuration.py +++ b/pyramid/configuration.py @@ -267,12 +267,6 @@ class Configurator(object): session_factory=session_factory, ) - @classmethod - def with_context(cls, context): - configurator = cls(registry=context.registry, package=context.package) - configurator._ctx = context - return configurator - def _action(self, discriminator, callable=None, args=(), kw=None, order=0): """ Register an action which will be executed during a commit. """ if kw is None: @@ -401,6 +395,12 @@ class Configurator(object): self._ctx.execute_actions() self._ctx = self._make_context(self._ctx.autocommit) + @classmethod + def with_context(cls, context): + configurator = cls(registry=context.registry, package=context.package) + configurator._ctx = context + return configurator + def with_package(self, package, _ctx=None): """ Return a new Configurator instance with the same registry as this configurator using the package supplied as the |
