summaryrefslogtreecommitdiff
path: root/docs/narr/viewconfig.rst
AgeCommit message (Collapse)Author
2013-01-06fix import typo in docsReed O'Brien
2013-01-01typoTshepang Lekhonkhobe
2012-10-28- Added an ``effective_principals`` route and view predicate.Chris McDonough
2012-10-26- New ``physical_path`` view predicate. If specified, this value should be aChris McDonough
string or a tuple representing the physical traversal path of the context found via traversal for this predicate to match as true. For example: ``physical_path='/'`` or ``physical_path='/a/b/c'`` or ``physical_path=('', 'a', 'b', 'c')``. This is not a path prefix match or a regex, it's a whole-path match. It's useful when you want to always potentially show a view when some object is traversed to, but you can't be sure about what kind of object it will be, so you can't use the ``context`` predicate. The individual path elements inbetween slash characters or in tuple elements should be the Unicode representation of the name of the resource and should not be encoded in any way.
2012-10-13add docs and changelog noteChris McDonough
2012-09-19A ``check_csrf`` view predicate was added. For example, you can now doChris McDonough
``config.add_view(someview, check_csrf=True)``. When the predicate is checked, if the ``csrf_token`` value in ``request.params`` matches the csrf token in the request's session, the view will be permitted to execute. Otherwise, it will not be permitted to execute.
2012-02-24More trivial typosPaul Winkler
2012-01-30clarify that there's no technical restriction on the value of request_methodPaul Winkler
2012-01-25Minor fix - change attribute to be prevent_auto rather than preserve_autodavidjb
2011-12-14Flesh out new view_defaults feature and add docs, change notes, and add to ↵Chris McDonough
whatsnew.
2011-09-07add squishy whats-unique section to introductionChris McDonough
2011-08-29add match_param to the narrative docsChris McDonough
2011-07-30Updated all of the docs to reflect the new pyramid.* settings prefix.Michael Merickel
2011-07-20- Reordered chapters in narrative section for better new user friendliness.Chris McDonough
- Added more indexing markers to sections in documentation.
2011-07-20add more index markersChris McDonough
2011-07-14Edited docs/narr/viewconfig.rst via GitHubAnneGilles
2011-07-13move all paster commands to a separate chapterChris McDonough
2011-07-12clarifyChris McDonough
2011-07-12- New environment setting ``PYRAMID_PREVENT_HTTP_CACHE`` and newChris McDonough
configuration file value ``prevent_http_cache``. These are synomymous and allow you to prevent HTTP cache headers from being set by Pyramid's ``http_cache`` machinery globally in a process. see the "Influencing HTTP Caching" section of the "View Configuration" narrative chapter and the detailed documentation for this setting in the "Environment Variables and Configuration Settings" narrative chapter. - New documentation section in View Configuration narrative chapter: "Influencing HTTP Caching".
2011-07-11simplify wordingChris McDonough
2011-07-11earlier info referenced later info, fixChris McDonough
2011-07-07Updated proutes and pviews docs.Michael Merickel
2011-07-04- A new value ``http_cache`` can be used as a view configurationChris McDonough
parameter. When you supply an ``http_cache`` value to a view configuration, the ``Expires`` and ``Cache-Control`` headers of a response generated by the associated view callable are modified. The value for ``http_cache`` may be one of the following: - A nonzero integer. If it's a nonzero integer, it's treated as a number of seconds. This number of seconds will be used to compute the ``Expires`` header and the ``Cache-Control: max-age`` parameter of responses to requests which call this view. For example: ``http_cache=3600`` instructs the requesting browser to 'cache this response for an hour, please'. - A ``datetime.timedelta`` instance. If it's a ``datetime.timedelta`` instance, it will be converted into a number of seconds, and that number of seconds will be used to compute the ``Expires`` header and the ``Cache-Control: max-age`` parameter of responses to requests which call this view. For example: ``http_cache=datetime.timedelta(days=1)`` instructs the requesting browser to 'cache this response for a day, please'. - Zero (``0``). If the value is zero, the ``Cache-Control`` and ``Expires`` headers present in all responses from this view will be composed such that client browser cache (and any intermediate caches) are instructed to never cache the response. - A two-tuple. If it's a two tuple (e.g. ``http_cache=(1, {'public':True})``), the first value in the tuple may be a nonzero integer or a ``datetime.timedelta`` instance; in either case this value will be used as the number of seconds to cache the response. The second value in the tuple must be a dictionary. The values present in the dictionary will be used as input to the ``Cache-Control`` response header. For example: ``http_cache=(3600, {'public':True})`` means 'cache for an hour, and add ``public`` to the Cache-Control header of the response'. All keys and values supported by the ``webob.cachecontrol.CacheControl`` interface may be added to the dictionary. Supplying ``{'public':True}`` is equivalent to calling ``response.cache_control.public = True``. Providing a non-tuple value as ``http_cache`` is equivalent to calling ``response.cache_expires(value)`` within your view's body. Providing a two-tuple value as ``http_cache`` is equivalent to calling ``response.cache_expires(value[0], **value[1])`` within your view's body. If you wish to avoid influencing, the ``Expires`` header, and instead wish to only influence ``Cache-Control`` headers, pass a tuple as ``http_cache`` with the first element of ``None``, e.g.: ``(None, {'public':True})``.
2011-06-03Some more small fixes in the narrative docu.Christoph Zwerschke
2011-05-04code refactoring for showing route->view relationship more correctly; tests ↵cguardia
and docs for pull request
2011-04-22- Make sure deprecation warnings aren't raised when tests are run.Chris McDonough
- Modify documentation for cross-referencing. - Use add_view(viewname) syntax rather than add_view(view=viewname) syntax for normalization. - Use warnings.warn rather than zope.deprecated in order to make testing easier. - Move tests which test deprecated methods of configurator to a separate test case.
2011-04-20Converting docs to deprecate view parameters in config.add_route.Michael Merickel
2011-02-26it's request_paramChris McDonough
2011-02-05fix conflictsChris McDonough
2011-01-30More errors in narrative fixed.Chris Beelby
2011-01-30inappropriate mentions of alternate declarative formsChris McDonough
2011-01-27module name contractionsChris McDonough
2011-01-27First batch of fixes for typo's and other language issues.Chris Beelby
2011-01-18- Most references to ZCML in narrative chapters have been removed orChris McDonough
redirected to ``pyramid_zcml`` locations.
2011-01-16- The ``pylons_minimal``, ``pylons_basic`` and ``pylons_sqla`` pasterChris McDonough
templates were removed. Use ``pyramid_sqla`` (available from PyPI) as a generic replacement for Pylons-esque development. - All references to ``add_handler`` and the ``handler`` ZCML directive have been removed from the docs, and stubs which point to ``pylons_handlers`` package have replaced them.
2011-01-13First pass at documenting the __action_decorator__ feature of a view handler.Rob Miller
2011-01-08fix renderingsChris McDonough
2011-01-02add intro paragraph to view config chaptCasey Duncan
2011-01-02:term: not :mod:Casey Duncan
2011-01-02Split view chapter, move view config after templates, some reordering in ↵Casey Duncan
view config