[pirate-politics] r616 committed - Created wiki page through web user interface.

2 views
Skip to first unread message

pirate-...@googlecode.com

unread,
Feb 10, 2011, 4:09:16 PM2/10/11
to pirate-poli...@googlegroups.com
Revision: 616
Author: fragro
Date: Thu Feb 10 13:08:36 2011
Log: Created wiki page through web user interface.
http://code.google.com/p/pirate-politics/source/detail?r=616

Added:
/wiki/pp_url.wiki

=======================================
--- /dev/null
+++ /wiki/pp_url.wiki Thu Feb 10 13:08:36 2011
@@ -0,0 +1,52 @@
+#summary To load this tag include {% load pp_url %} at the top of the html
file.
+#sidebar TableOfContents
+
+= Custom Tag: `pp_url` =
+====_Module: pirate_core_====
+
+This block tag will produce a url that will link to the designated html
file with the `template` argument, and then will optionally populate the
request passed to that view with either a specific ORM object, or a
numerical range `start` and `end`, as long as the
pirate_core.url_middleware.UrlMiddleware is included in the projects'
MIDDLEWARE_CLASSES. Any kwargs included in addition
to "view", "object", "start" and "end" any other valid arguments will be
passed to redirect in order to produce the url for the designated view.
+
+ The default value for "view" is "pp-page", which expects that the
kwarg "template" be included, passing in the name of the template being
linked to. Template authors can ignore this argument for now.
+
+==_Arguments and Parameters_==
+
+ * object: the ORM object being reference as `request.object` in the
template
+ * template: the html template the link redirects to
+ * start: start range integer
+ * end: end range integer
+ * dimension: ranking dimension if the list is an Consensus list
+ * scroll_to: refers to a div in the css to scroll to after the page
loads. Requires javascript.
+ * return_path: argument needed to generate `request.returnurl` in the
template context, parameter can be specified `request.META.PATH_INFO` for
the active template
+ * return_query: argument needed to generate `request.returnurl` in the
template context, parameter can be specified as `request.META.QUERY_STRING`
for the active template
+
+==_Return value_==
+
+The pp_url tag redirects to the `template` html file, and populates the
request with the following variables that are passed through the `pp_url`
arguments. This context will not be available if it is not passed into
through `pp_url`.
+
+ * `request.object`
+ * `request.start`
+ * `request.end`
+ * `request.dimension`
+ * `request.scroll_to`
+ * `request.return_url`
+
+==_Usage Notes_==
+ * *Assumptions*: None
+
+ * *Errors*: None
+
+==_Examples_==
+====Basic form====
+The following code will display a link.
+{{{
+ <a href="{% pp_url template='issues.html' dimension='hot' start=0
end=20 %}">issues</a>
+
+<a href="{% pp_url template='issues.html' dimension='hot'
start=request.start end=request.end %}">{% ifequal "hot"
request.dimension %}<b>hot</b>{% else %}hot{% endifequal %}</a>
+
+<a href="{% pp_url template='user_profile.html' object=request.user%}"
></a>
+
+<a href="{% pp_url template='register.html'
return_path=request.META.PATH_INFO
return_query=request.META.QUERY_STRING %}">register</a>
+
+
+
+}}}

Reply all
Reply to author
Forward
0 new messages