summaryrefslogtreecommitdiff
path: root/docs
AgeCommit message (Collapse)Author
2009-05-01Note new index location for BFG.Chris McDonough
2009-04-30Remove incorrect info from security chapter.Chris McDonough
2009-04-30Make ModelGraphTraverser assume that all traversed objects provide ↵Chris McDonough
ILocation. Make WrappingModelGraphTraverser assume that *no* traversed objects provide ILocation. This makes it unnecessary to explain why the root object in a WrappingModelGraphTraverser setup needs to supply the ILocation interface. Now it doesn't.
2009-04-29Drop the ILocation testing by default during traversal.Tres Seaver
2009-04-18- Added better documentation for virtual hosting at a URL prefixChris McDonough
within the virtual hosting docs chapter.
2009-04-16- The interface for ``repoze.bfg.interfaces.ITraverser`` and theChris McDonough
built-in implementations that implement the interface (``repoze.bfg.traversal.ModelGraphTraverser``, and ``repoze.bfg.urldispatch.RoutesModelTraverser``) now expect the ``__call__`` method of an ITraverser to return 3 additional arguments: ``traversed``, ``virtual_root``, and ``virtual_root_path`` (the old contract was that the ``__call__`` method of an ITraverser returned; three arguments, the contract new is that it returns six). ``traversed`` will be a sequence of Unicode names that were traversed (including the virtual root path, if any) or ``None`` if no traversal was performed, ``virtual_root`` will be a model object representing the virtual root (or the physical root if traversal was not performed), and ``virtual_root_path`` will be a sequence representing the virtual root path (a sequence of Unicode names) or ``None`` if traversal was not performed. Six arguments are now returned from BFG ITraversers. They are returned in this order: ``context``, ``view_name``, ``subpath``, ``traversed``, ``virtual_root``, and ``virtual_root_path``. Places in the BFG code which called an ITraverser continue to accept a 3-argument return value, although BFG will generate and log a warning when one is encountered. - The request object now has the following attributes: ``traversed`` (the sequence of names traversed or ``None`` if traversal was not performed), ``virtual_root`` (the model object representing the virtual root, including the virtual root path if any), and ``virtual_root_path`` (the seuquence of names representing the virtual root path or ``None`` if traversal was not performed). - A new decorator named ``wsgiapp2`` was added to the ``repoze.bfg.wsgi`` module. This decorator performs the same function as ``repoze.bfg.wsgi.wsgiapp`` except it fixes up the ``SCRIPT_NAME``, and ``PATH_INFO`` environment values before invoking the WSGI subapplication. - The ``repoze.bfg.testing.DummyRequest`` object now has default attributes for ``traversed``, ``virtual_root``, and ``virtual_root_path``. - The RoutesModelTraverser now behaves more like the Routes "RoutesMiddleware" object when an element in the match dict is named ``path_info`` (usually when there's a pattern like ``http://foo/*path_info``). When this is the case, the ``PATH_INFO`` environment variable is set to the value in the match dict, and the ``SCRIPT_NAME`` is appended to with the prefix of the original ``PATH_INFO`` not including the value of the new variable. - The notfound debug now shows the traversed path, the virtual root, and the virtual root path too.
2009-04-11Prep for 0.7.0.Chris McDonough
2009-04-11Tweaks.Chris McDonough
2009-04-11Rendering.Chris McDonough
2009-04-11- The default request charset encoding is now ``utf-8``. As a result,Chris McDonough
the request machinery will attempt to decode values from the utf-8 encoding to Unicode automatically when they are obtained via ``request.params``, ``request.GET``, and ``request.POST``. The previous behavior of BFG was to return a bytestring when a value was accessed in this manner. This change will break form handling code in apps that rely on values from those APIs being considered bytestrings. If you are manually decoding values from form submissions in your application, you'll either need to change the code that does that to expect Unicode values from ``request.params``, ``request.GET`` and ``request.POST``, or you'll need to explicitly reenable the previous behavior. To reenable the previous behavior, add the following to your application's ``configure.zcml``:: <subscriber for="repoze.bfg.interfaces.INewRequest" handler="repoze.bfg.request.make_request_ascii"/> See also the documentation in the "Views" chapter of the BFG docs entitled "Using Views to Handle Form Submissions (Unicode and Character Set Issues)".
2009-04-11Add text target to makefile.Chris McDonough
2009-03-24Rearrange.Chris McDonough
2009-03-24Better virtualenv docs.Chris McDonough
2009-03-18Fix grammar.Mike Naberezny
2009-02-16Prep for 0.6.9.Chris McDonough
2009-02-13Typo.Chris McDonough
2009-02-06Update test results.Chris McDonough
2009-02-06Prep for 0.6.8.Chris McDonough
2009-02-06Docs renderings.Chris McDonough
2009-02-06Revert my decision to make ``model_path`` return a tuple; itChris McDonough
now still returns a string; albeit a quoted one. An additional API (model_path_tuple) now also exists which can be used to get a model path as a tuple. - The ``repoze.bfg.traversal.model_path`` API now returns a *quoted* string rather than a string represented by series of unquoted elements joined via ``/`` characters. Previously it returned a string or unicode object representing the model path, with each segment name in the path joined together via ``/`` characters, e.g. ``/foo /bar``. Now it returns a string, where each segment is a UTF-8 encoded and URL-quoted element e.g. ``/foo%20/bar``. This change was (as discussed briefly on the repoze-dev maillist) necessary to accomodate model objects which themselves have ``__name__`` attributes that contain the ``/`` character. For people that have no models that have high-order Unicode ``__name__`` attributes or ``__name__`` attributes with values that require URL-quoting with in their model graphs, this won't cause any issue. However, if you have code that currently expects ``model_path`` to return an unquoted string, or you have an existing application with data generated via the old method, and you're too lazy to change anything, you may wish replace the BFG-imported ``model_path`` in your code with this function (this is the code of the "old" ``model_path`` implementation):: from repoze.bfg.location import lineage def i_am_too_lazy_to_move_to_the_new_model_path(model, *elements): rpath = [] for location in lineage(model): if location.__name__: rpath.append(location.__name__) path = '/' + '/'.join(reversed(rpath)) if elements: suffix = '/'.join(elements) path = '/'.join([path, suffix]) return path - The ``repoze.bfg.traversal.find_model`` API no longer implicitly converts unicode representations of a full path passed to it as a Unicode object into a UTF-8 string. Callers should either use prequoted path strings returned by ``repoze.bfg.traversal.model_path``, or tuple values returned by the result of ``repoze.bfg.traversal.model_path_tuple`` or they should use the guidelines about passing a string ``path`` argument described in the ``find_model`` API documentation. - Each argument contained in ``elements`` passed to ``repoze.bfg.traversal.model_path`` will now have any ``/`` characters contained within quoted to ``%2F`` in the returned string. Previously, ``/`` characters in elements were left unquoted (a bug). - A ``repoze.bfg.traversal.model_path_tuple`` API was added. This API is an alternative to ``model_path`` (which returns a string); ``model_path_tuple`` returns a model path as a tuple (much like Zope's ``getPhysicalPath``). - A ``repoze.bfg.traversal.quote_path_segment`` API was added. This API will quote an individual path segment (string or unicode object). See the ``repoze.bfg.traversal`` API documentation for more information.
2009-01-27Prep for 0.6.7.Chris McDonough
2009-01-27Docs renderings.Chris McDonough
2009-01-27FeaturesChris McDonough
-------- - The ``repoze.bfg.url.model_url`` API now works against contexts derived from Routes URL dispatch (``Routes.util.url_for`` is called under the hood). - "Virtual root" support for traversal-based applications has been added. Virtual root support is useful when you'd like to host some model in a :mod:`repoze.bfg` model graph as an application under a URL pathname that does not include the model path itself. For more information, see the (new) "Virtual Hosting" chapter in the documentation. - A ``repoze.bfg.traversal.virtual_root`` API has been added. When called, it returns the virtual root object (or the physical root object if no virtual root has been specified). Implementation Changes ---------------------- - ``repoze.bfg.traversal.RoutesModelTraverser`` has been moved to ``repoze.bfg.urldispatch``. - ``model_url`` URL generation is now performed via an adapter lookup based on the context and the request. - ZCML which registers two adapters for the ``IContextURL`` interface has been added to the configure.zcml in ``repoze.bfg.includes``.
2009-01-27Prep for 0.6.6.Chris McDonough
2009-01-26Rendering.Chris McDonough
2009-01-26Prep for 0.6.5.Chris McDonough
2009-01-26- Added a ``traversal_path`` API to the traversal module; see theChris McDonough
"traversal" API chapter in the docs. This was a function previously known as ``split_path`` that was not an API but people were using it anyway. Unlike ``split_path`` it now returns a tuple instead of a list (as its values are cached).
2009-01-26Make renderable.Chris McDonough
2009-01-25Note deprecation.Chris McDonough
2009-01-25Root factory nomenclature.Chris McDonough
2009-01-25Rendering.Chris McDonough
2009-01-25Document Routes ZCML attrs.Chris McDonough
2009-01-25Document sequence-ability of ACE permission list.Chris McDonough
2009-01-25- You can now override the NotFound and Unauthorized responses thatChris McDonough
:mod:`repoze.bfg` generates when a view cannot be found or cannot be invoked due to lack of permission. See the "ZCML Hooks" chapter in the docs for more information. - Use a homegrown Unauthorized error instead of ``webob.exc.Unauthorized`` (the latter is slow). - Various speed micro-tweaks.
2009-01-23Prep for 0.6.4.Chris McDonough
2009-01-23Path elements are always unicode during traversal now.Chris McDonough
2009-01-22- The ``unicode_path_segments`` configuration variable and theChris McDonough
``BFG_UNICODE_PATH_SEGMENTS`` configuration variable have been removed. Path segments are now always passed to model ``__getitem__`` methods as unicode. "True" has been the default for this setting since 0.5.4, but changing this configuration setting to false allowed you to go back to passing raw path element strings to model ``__getitem__`` methods. This services a speed goal (we get about +80 req/s by removing the check), and it's clearer just to always expect unicode path segments in model ``__getitem__`` methods.
2009-01-21Document after Rob had trouble.Chris McDonough
2009-01-19Note static installation of lxml as an alternative.Paul Everitt
2009-01-19Small typo fix.Paul Everitt
2009-01-19Prep for 0.6.3.Chris McDonough
2009-01-19Get rid of warning.Chris McDonough
2009-01-19view_name attr.Chris McDonough
2009-01-19(no commit message)Chris McDonough
2009-01-18context_factory -> factoryChris McDonough
context_interfaces -> provides
2009-01-18Merge "routesmapper branch" to trunk.Chris McDonough
2009-01-18grok -> scan to prevent confusion.Chris McDonough
2009-01-17- Added a "Using ZPT Macros in repoze.bfg" section to the narrativeChris McDonough
templating chapter.
2009-01-17(no commit message)Chris McDonough
2009-01-17(no commit message)Chris McDonough