diff options
| author | Chris McDonough <chrism@plope.com> | 2010-12-28 21:02:36 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2010-12-28 21:02:36 -0500 |
| commit | fcfc5aebc259fa34d8d2313adde7c2f57bab2e53 (patch) | |
| tree | c52e454f30ca7453da814e57635accc302d61b2b /docs/narr/resources.rst | |
| parent | e8f26928bf5c8fb8490a72436718cedf8fe19281 (diff) | |
| parent | 02c43fe07f1ffe0cc27e539618ed8d96014cddee (diff) | |
| download | pyramid-fcfc5aebc259fa34d8d2313adde7c2f57bab2e53.tar.gz pyramid-fcfc5aebc259fa34d8d2313adde7c2f57bab2e53.tar.bz2 pyramid-fcfc5aebc259fa34d8d2313adde7c2f57bab2e53.zip | |
Merge branch 'master' into viewderiver
Diffstat (limited to 'docs/narr/resources.rst')
| -rw-r--r-- | docs/narr/resources.rst | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/docs/narr/resources.rst b/docs/narr/resources.rst index f90b1eb12..8cf2cead2 100644 --- a/docs/narr/resources.rst +++ b/docs/narr/resources.rst @@ -324,6 +324,11 @@ would have been what was returned anyway, but your code can perform arbitrary logic as necessary. For example, your code may wish to override the hostname or port number of the generated URL. +Note that the URL generated by ``__resource_url__`` should be fully +qualified, should end in a slash, and should not contain any query string or +anchor elements (only path elements) to work best with +:func:`pyramid.url.resource_url`. + Generating the Path To a Resource --------------------------------- @@ -399,7 +404,7 @@ Obtaining the Lineage of a Resource ----------------------------------- :func:`pyramid.location.lineage` returns a generator representing the -:term:`lineage` of the :term:`location` aware:term:`resource` object. +:term:`lineage` of the :term:`location` aware :term:`resource` object. The :func:`~pyramid.location.lineage` function returns the resource it is passed, then each parent of the resource, in order. For example, if the @@ -528,7 +533,7 @@ declares that the blog entry implements an :term:`interface`. implements(IBlogEntry) def __init__(self, title, body, author): self.title = title - self.body = body + self.body = body self.author = author self.created = datetime.datetime.now() @@ -563,7 +568,7 @@ To do so, use the :func:`zope.interface.directlyProvides` function: class BlogEntry(object): def __init__(self, title, body, author): self.title = title - self.body = body + self.body = body self.author = author self.created = datetime.datetime.now() @@ -591,7 +596,7 @@ the :func:`zope.interface.alsoProvides` function: class BlogEntry(object): def __init__(self, title, body, author): self.title = title - self.body = body + self.body = body self.author = author self.created = datetime.datetime.now() |
