diff --git a/ordr2/resources/__init__.py b/ordr2/resources/__init__.py index 938d86a..ebb7a68 100644 --- a/ordr2/resources/__init__.py +++ b/ordr2/resources/__init__.py @@ -1,10 +1,11 @@ class Root(object): + ''' Root resource ''' + __name__ = None __parent__ = None - -def root_factory(request): - return Root() + def __init__(self, request): + self._request = request def includeme(config): @@ -14,5 +15,5 @@ def includeme(config): Activate this setup using ``config.include('ordr2.resources')``. ''' - config.set_root_factory(root_factory) + config.set_root_factory(Root) config.add_static_view('static', 'ordr2:static', cache_max_age=3600)