From 27862b83712010e4d3f843f74111df260188d321 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 30 Oct 2009 20:06:22 +0000 Subject: Update documentation after root factory changes. --- docs/tutorials/bfgwiki2/authorization.rst | 4 ++-- docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/tutorials/bfgwiki2') diff --git a/docs/tutorials/bfgwiki2/authorization.rst b/docs/tutorials/bfgwiki2/authorization.rst index e158b3e87..d2a181281 100644 --- a/docs/tutorials/bfgwiki2/authorization.rst +++ b/docs/tutorials/bfgwiki2/authorization.rst @@ -37,8 +37,8 @@ statements to your ``models.py`` file: class RootFactory(object): __acl__ = [ (Allow, Everyone, 'view'), (Allow, 'editor', 'edit') ] - def __init__(self, environ): - self.__dict__.update(environ['bfg.routes.matchdict']) + def __init__(self, request): + self.__dict__.update(request.matchdict) The ``RootFactory`` class we've just added will be used by :mod:`repoze.bfg` to construct a ``context`` object. The context is diff --git a/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py b/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py index 283ddea74..db2095ad1 100644 --- a/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py +++ b/docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py @@ -33,8 +33,8 @@ class Page(Base): class RootFactory(object): __acl__ = [ (Allow, Everyone, 'view'), (Allow, 'editor', 'edit') ] - def __init__(self, environ): - self.__dict__.update(environ['bfg.routes.matchdict']) + def __init__(self, request): + self.__dict__.update(request.matchdict) def initialize_sql(db, echo=False): engine = create_engine(db, echo=echo) -- cgit v1.2.3