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

1 view
Skip to first unread message

pirate-...@googlecode.com

unread,
Feb 9, 2011, 5:05:59 AM2/9/11
to pirate-poli...@googlegroups.com
Revision: 564
Author: fragro
Date: Wed Feb 9 02:05:46 2011
Log: Created wiki page through web user interface.
http://code.google.com/p/pirate-politics/source/detail?r=564

Added:
/wiki/pp_user_registration_form.wiki

=======================================
--- /dev/null
+++ /wiki/pp_user_registration_form.wiki Wed Feb 9 02:05:46 2011
@@ -0,0 +1,49 @@
+#summary To load this tag include {% load usertags %} at the top of the
html file.
+#sidebar TableOfContents
+
+= Custom Tag: `pp_user_registration_form` =
+====_Module: pirate_login_====
+
+This template tag populates the namespace `pirate_login` with the
registration form. It takes a couple of arguments so that the system can
easily redirect the user to the page they were on previously. As a result
when calling the `pp_url` for `register.html` use the following code `{%
pp_url template='register.html' return_path=request.META.PATH_INFO
return_query=request.META.QUERY_STRING %}`.
+
+==_Arguments and Parameters_==
+
+ * request: the WSGI object, needed for Django user methods
+
+ * return_path: usually `request.META.PATH_INFO` supplied to the tag for
registration, if we want to load the same page the user is on when the
registration form is called. This will be explained further in Assumptions.
+
+ * return_query: usually `request.META.QUERY_STRING` suppled to the tag in
concert with return_path
+
+ * returnurl: provides a full url to return to
+
+==_Return value_==
+
+Returns a form containing a HTML form object the user can enter the
registration info into.
+
+ * `pp_consensus.neutvoteimg`: References the file location of the
neutralvote image, so that image can be referenced by functions in the html
+
+==_Usage Notes_==
+ * *Assumptions*: If one of return_path/return_query is provided, both
must be provided. If the user has been directed to a `register.html` page
through the `pp_url` tag, then `request.returnurl` should be available in
the context to pass as an argument.
+
+ * *Errors*: None
+
+==_Examples_==
+====Basic form====
+The following code will display the form returned by this tag.
+
+{{{
+{% pp_user_registration_form returnurl=request.returnurl request=request %}
+ Username:<br>
+ {{ pp_login.form.name }}<br>
+ Password:<br>
+ {{ pp_login.form.password1 }}<br>
+ Check Password:<br>
+ {{ pp_login.form.password2 }}<br>
+ Email:<br>
+ {{ pp_login.form.email }}<br><br>
+ {{ pp_login.form.form_id}}
+ {% csrf_token %}
+ <input type="submit" class="button green" value="Register">
+ <div class="error">{{pp_login.errors}}<br>{{ pp_login.form.errors
}}</div>
+</form>
+}}}

Reply all
Reply to author
Forward
0 new messages