Modified:
/wiki/pp_solution_form.wiki
=======================================
--- /wiki/pp_solution_form.wiki Tue Feb 8 20:51:34 2011
+++ /wiki/pp_solution_form.wiki Tue Feb 8 21:04:15 2011
@@ -25,18 +25,8 @@
The data within this object are:
- * `pp_solution.count`:
- This contains the HTML code for a form that can be used to create a new
issue. If this is used, none of the other fields need to be displayed since
this includes them all. Information about how this object can be slightly
formatted is
[http://docs.djangoproject.com/en/1.2/ref/forms/api/#outputting-forms-as-html
here].
-
- * `pp_solution.solution_list`:
- This contains the HTML code for the input tag that should be filled the
name of the group. Each solution subsequently includes the following data
variables:
- * issue = Parent issue
- * name = Name of the solution
- * text = Description of this solution
- * submit_date = Date and time of the solution submission
- * user = User who submitted this solution
- * arguments = Number of arguments associated with this solution
-
+ * `pp_solutions.form`:
+ This contains the HTML code for a form that can be used to create a new
solution. If this is used, none of the other fields need to be displayed
since this includes them all. Information about how this object can be
slightly formatted is
[http://docs.djangoproject.com/en/1.2/ref/forms/api/#outputting-forms-as-html
here].
==_Usage Notes_==
@@ -46,14 +36,18 @@
==_Examples_==
====Basic form====
-The following code will create an html form and will save the data when it
is posted. That data would then be viewable by pp_permgroup_list.
-Each issue object needs to be referenced as `iss_obj` to take advantage of
the `{% include '_solution.html' %}`. This html file references 'iss_obj'.
+
{{{
-{% pp_get_solution_list issue=request.object dimension=request.dimension %}
- {%for iss_obj in pp_solution.solution_list%}
- {% include '_solution.html' %}
- {% empty %}
- No solutions yet! Add a solution.
- {% endfor %}
+{% pp_solution_form POST=request.POST path=request.path
object=request.object request=request %}
+ <h2>Submit a new solution for: {{request.object.name}}</h2>
+ {{ pp_solution.form.errors }}
+ <form method="post" action="">
+ Name: <br>{{ pp_solution.form.name }}<br>
+ Text: <br>{{ pp_solution.form.text }}
+ {{ pp_solution.form.form_id}}
+ {% csrf_token %}
+ <input type="submit" class="button green" value="Submit Solution" />
+ </form>
+{% endpp_solution_form %}
}}}