On Jan 16, 2009, at 5:10 PM, Gath wrote:
>
> Am building a Q&A page, sort of stackoverflow.com kinda page! Am
> having a bit of a problem trying to render the form. Am pasing 3
> objects to the template that renders the page i.e. Question object,
> Answers related to the question and Answer form object.
>
> In the first part of the page i want to display the Question, then the
> answers list related to the question follows, then at the bottom of
> the page i display my form to enter the new answer.
>
> On my template when i use the {{ extends "base_site.html" }} tag,
> then only the form get rendered without the first part of questions,
> When i remove that tag then only the Question section get displayed
> minus the form!!
Generally when you extend another template you need to be filling in
blocks in that template. So the template below, in addition to {%
block title %}, should probably be putting the rest of the content
into a block that corresponds to a block in the base_site.html
template. What does base_site.html look like?
E
>
> How can i go round this problem?
>
> this my template;
>
> {% extends "base_site.html" %}
>
> {% block title %}{% endblock %}
>
> <link rel="stylesheet" type="text/css" href="/site_media/twine.css" /
>>
>
> <div id="container">
>
> <div id="content">
>
>
> <div id="mainbar">
>
>
> <div id="subheader">
> <h1>{{ questobj.question }}</h1>
> </div>
>
> <div class="answer-summary">
> <br><font color="black">{{ questobj.notes }}</font></br>
> </div>
>
>
> {% regroup answerobj.object_list by answer as ans_list %}{{ ans_list|
> length }} -->
>
>
> {% for answers in answerobj.object_list %}
> <br><h1><a href="/list_answer/">{{ answers.answer
> }}</a></h1></br>
> <font size="-2" color="gold">posted on:{{ answers.post_date }}</
> font>
> by:<b><font color="gold"><a
> href="/user_profile/">{{answers.userid}}
> </b></font>
>
> {% endfor %}
>
> </div>
> </div>
> </div> <!-- container -->
>
>
> <div>
>
> <form action="." method="POST">
>
>
> <table>
>
> {{ form.as_table }}
>
> </table>
>
> <div class="submit-row">
>
> <p><input type="submit" value="submit" name=_"save"></p>
>
> </div>
>
> </form>
>
> </div>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---