[Checkins] SVN: grok/trunk/doc/reference/functions.tex Remove
potentially confusing example for grok.url, since grok.View
Jan-Wijbrand Kolman
jw at infrae.com
Fri Jun 1 04:12:56 EDT 2007
Log message for revision 76070:
Remove potentially confusing example for grok.url, since grok.View
classes have a url method that should be used in views instead.
Add a primitive see also for grok.url to grok.View. We need a beter
way of referencing.
Changed:
U grok/trunk/doc/reference/functions.tex
-=-
Modified: grok/trunk/doc/reference/functions.tex
===================================================================
--- grok/trunk/doc/reference/functions.tex 2007-06-01 07:55:01 UTC (rev 76069)
+++ grok/trunk/doc/reference/functions.tex 2007-06-01 08:12:55 UTC (rev 76070)
@@ -1,43 +1,32 @@
\chapter{Functions}
-The \module{grok} module provides access to commonly used functions in the
-Zope Component Architecture.
-
- \section{\function{grok.getSite}}
-
- \begin{funcdesc}{grok.getSite}{*args}
- foobar
- \end{funcdesc}
-
- \section{\function{grok.notify}}
-
- \begin{funcdesc}{grok.notify}{*args}
- foobar
- \end{funcdesc}
-
The \module{grok} module provides a number of convenience functions to aid in
common tasks.
- \section{\function{grok.url}}
+ \section{\function{grok.getSite}}
- \begin{funcdesc}{grok.url}{request, object, \optional{, name}}
- Construct a URL for the given \var{request} and \var{object}.
+ \begin{funcdesc}{grok.getSite}{*args}
+ foobar
+ \end{funcdesc}
- \var{name} may be a string that gets appended to the object URL.
- Commonly used to construct an URL to a particular view on the object.
+ \section{\function{grok.notify}}
- This function returns the constructed URL as a string.
+ \begin{funcdesc}{grok.notify}{*args}
+ foobar
+ \end{funcdesc}
- An example, that uses grok.url inside a view class:
- \begin{verbatim}
-import grok
+ \section{\function{grok.url}}
-class SomeView(grok.View):
+ \begin{funcdesc}{grok.url}{request, object, \optional{, name}}
+ Construct a URL for the given \var{request} and \var{object}.
- def render(self):
- parent_url = grok.url(
- self.request, self.context.__parent__, 'index')
- return '<a href="%s">parent</a>' % parent_url
- \end{verbatim}
+ \var{name} may be a string that gets appended to the object URL. Commonly
+ used to construct an URL to a particular view on the object.
- \end{funcdesc}
\ No newline at end of file
+ This function returns the constructed URL as a string.
+
+ \begin{seealso}
+ View classes derived from \class{grok.View} have a similar \method{url}
+ method for constructing URLs.
+ \end{seealso}
+ \end{funcdesc}
More information about the Checkins
mailing list