Hi people!!

I need help trying to understand templates.

Let me explain where I am. I have finished the django tutorial and I
am assuming ( been right or wrong, I dont know) that the best thing to
do is to use the template automatic generation. eg, I have a class
Galeria and to have a layout to its list I just have to create a path
to it ((r'^$', 'django.views.generic.list_detail.object_list',
info_dict), where info_dict = { 'queryset' : Galeria.objects.all()})
and then create a file galeria_list.html like:

{% if object_list %}
                <td>
                {% for object in object_list %}
                        {{ object.nome }}
                {% endfor %}
                </td>
        {% else %}
                <p>No polls are available.</p>
        {% endif %}

So far so good.

The problem is that I want to put this part of the code as a menu,
extending the base.html. But it stops workig when I did:

{% extends "base.html" %}

{% block menu %}
<table>
<tr>
        {% if object_list %}
                <td>
                {% for object in object_list %}
                        {{ object.nome }}
                {% endfor %}
                </td>
        {% else %}
                <p>No polls are available.</p>
        {% endif %}
</tr>
</table>
{% endblock %}

It stops to work.

So I would like to ask for help to understand whats the better way for
doing it and what I have to change. It seems that I should not use the
automatic generator, Am I right?

Thanks fellows!

Regards,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to