I have created a form in Django but when I want to show the details of a record it does not bring me the update date, I would like to see why it does not bring me that information.
models.py :
from django.db import models
class Empleados(models.Model):
OPCIONES_GENERO_CHOICES = (
('M', 'Masculino'),
('F', 'Femenino'),
)
nombre = models.CharField(max_length=15)
apellidos = models.CharField(max_length=15)
ci = models.IntegerField(unique=True)
genero = models.CharField(max_length=255, choices=OPCIONES_GENERO_CHOICES, blank=True, null=True)
cargo = models.CharField(max_length=15)
creado = models.DateTimeField(auto_now_add=True)
email = models.EmailField()
telefono = models.CharField(max_length=12)
documento = models.FileField(
upload_to="archivo/",
null=True,
blank=True
)
def __str__(self):
return '%s' % self.nombre
class ActualizacionEmpleado(models.Model):
empleado = models.ForeignKey('Empleados', null = False, blank = False, on_delete = models.CASCADE)
fecha_actualizacion = models.DateTimeField(auto_now_add=True)
def __str__(self):
return '%s' % self.empleado
details.html :
{% extends 'base/base.html' %}
{% block Contenido %}
<div class="container">
<div class="row">
<div class="col-md-6 col.lg-3">
<h4>Registro ID #: </h4>
<ul><p>{{ object.id }}</p></ul>
<h4>Nombre: </h4>
<ul><p>{{ object.nombre }}</p></ul>
<h4>Apellidos: </h4>
<ul><p>{{ object.apellidos }}</p></ul>
<h4>Cedula de identidad: </h4>
<ul><p>{{ object.ci }}</p></ul>
<h4>Genero: </h4>
<ul><p>{{ object.genero }}</p></ul>
<h4>Fecha de ingreso: </h4>
<ul><p>{{ object.creado }}</p></ul>
<h4>Email: </h4>
<ul><p>{{ object.email }}</p></ul>
<h4>Telefono: </h4>
<ul><p>{{ object.telefono }}</p></ul>
<h4>Documento: </h4>
<ul><p>{{ object.documento }}</p></ul>
<h4>Ultima actualizacion: </h4>
<ul><p>{{ object.actualizacionempleado.fecha_actualizacion }}</p></ul>
</div>
</div>
<center>
<FORM name="buttonbar">
<INPUT TYPE="button" VALUE="Regresar" onClick="history.back()">
</FORM>
</center>
<center>
<input type="button" name="Submit" value="imprimir" onclick="javascript:window.print()">
</center>
</div>
{% endblock %}
What do I lack? Because when I call for details, it brings me all the information requested, except for the update date.