Hi, I've made some changes to my templates and something is broken but
I just can't find out why.
I have a base.html template with my site basic structure. Then a
viaje.html template which displays an object from the database, and
finally I have a viaje_sg_a.html template which should add a form to
edit some parts of the Viaje object. viaje_sg_a.html extends
viaje.html and defines a block where the form is. The problem is the
form never gets to the final html.
I've tried removing the extends tag and the code in viaje_sg_a.html
renders just fine. I've changed the name of the blocks but no luck
either.
Please can someone take a look at this, is really weird.
base.html
--------------
{# vim: set fileencoding=utf-8 : #}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/
TR/html4/strict.dtd">
<html>
<head>
<title>{% block title %}{{titulo}}{% endblock title %} |Narf</
title>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<link rel="stylesheet" href="/static/css/base.css" type="text/
css" title="Base">
{% block style %} {% endblock style %}
{% block script %} {% endblock script %}
</head>
<body>
{% block body %}{% block header %}<div id="header">Narf<span
id="angulos"><a href="/res">Reservas
{% block contenido %}Contenido{% endblock contenido %}
{% if mensajes %}<div id="mensajes">{% block mensajes %}{%
endblock %}</div>{% endif %}
{% if debug %} {% block debug %}<div id="debug">
<h2>Debug</h2>
<table summary="informacion de debug">
{% for i in debug.items %}
<tr>
<td><strong>{{i.0}}</strong></td> <td>{{i.1}}</td>
</tr>
{% endfor %}
</table>
</div> {% endblock %}{% endif %}
{% block footer %}<div id="footer">
<a href="http://www.python.org/">
<img class="stiker" src="/media/img/python-powered-
w-70x28.png" alt="Python Logo" title=
</a>
<a href="http://www.djangoproject.com/">
<img class="stiker" src="/media/img/
djangoproject120x25.gif" alt="a Django project" titl
</a>
</div>{% endblock %}{% endblock %}
</body>
</html>
viaje.html
--------------
{# vim: set fileencoding=utf-8 : #}
{% extends 'proto0/base.html' %}{% load narf_tags %}{% block
contenido %}
<h1>Viaje {{viaje.id}}</h1>
<h2>Datos</h2>{% block viajeDatos %}
<table summary="datos del viaje" class="compacta">
<tr> <th>Estado Operativo</th><th>Estado Contable</th><td
colspan="2" rowspan="2"> </td> </t
<tr> <td>{{viaje.get_estadoOpera_display}}</
td><td>{{viaje.get_estadoConta_display}}</td> </tr>
<tr> <th>Inicio</th><th>Fin</th><th title="Cantidad de
pasajeros">#</th><th>Pasajeros</th> </tr>
<tr> <td>{{viaje.fechaI|date:"d.M.Y"}}</td><td>{{viaje.fechaF|
date:"d.M.Y"}}</td><td>{{viaje.cant
<tr> <th colspan="2">Cliente</th><th>Referencia</th><th>Pedido
por</th> </tr>
<tr> <td colspan="2">{{viaje.cliente}}</
td><td>{{viaje.referencia}}</td><td>{{viaje.pedidoPor|def
<tr> <th>Cargado el</th><th>Ultimo cambio</th><th>Cargado por</
th><th>Reservado por</th> </tr>
<tr> <td>{{viaje.fechaCreado|date:"d.M.Y"}}</
td><td>{{viaje.fechaCambio|date:"d.M.Y"}}</td><td>{{
<tr> <th colspan="4">Notas</th> </tr>
<tr> <td colspan="4">{{viaje.notas}}</td> </tr>
</table>
<form action="/res/viaje/{{viaje.id}}/m/" method="get"
class="toolbar">
<input type="submit" value="( m )" title="Modificar los datos del
viaje" class="modificar">
</form>{% endblock viajeDatos %}
<h2>Servicios</h2>
<ol class="segmentos">{% for seg in viaje.segmentos.all %}
{% ifequal seg.id seg_activo %}<li class="activo" id="activo">
{% block segmentoA %}{% include 'proto0/res/segmento_data.html' %}
{% endblock segmentoA %}
{% block formA %}{% include 'proto0/res/segmento_form.html' %}{%
endblock formA %}
</li>{% else %}<li>
{% include 'proto0/res/segmento_data.html' %}
{% include 'proto0/res/segmento_form.html' %}
</li>{% endifequal %}{% endfor %}
</ol>{% endblock contenido %}
viaje_sg_a.html
----------------------
{# vim: set fileencoding=utf-8 : #}
{% extends 'proto0/res/viaje.html' %}
{% block form_a %}
<form action="/res/viaje/{{viaje.id}}/s{{seg.id}}/m/" method="post"
class="ancho50 agregar">
<h2 id="agregarSegmentos">Agregar segmentos</h2>
<fieldset><legend>Ciudades más usadas</legend>
<ol class="top">{% for f in form %}{% if not forloop.last %}
<li>{{f}} {{f.label_tag}}</li>{% else %}
</ol>
</fieldset>
<fieldset><legend>Otras ciudades</legend>{{f}}</fieldset>{% endif
%}{% endfor %}
<div class="errors">{{form.errors}}</div>
<div class="botones">
<input class="submit" type="submit" name="action"
value="Agregar">
<input class="submit" type="submit" name="action"
value="Cancelar">
</div>
</form>{% endblock form_a %}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---