У меня проблема при просмотре модели с отношением m2m в django admin. это моя модель:
class PagoEmpleado(models.Model):
cod_pago = models.AutoField(unique=True, primary_key=True)
cantidad = models.IntegerField(blank=True, null=True, default='1')
monto = models.DecimalField(decimal_places=2, max_digits=20, default='0',blank=True, null=True)
formula = models.CharField(max_length=250 ,blank=True, null=True)
class Prenomina(models.Model):
PG = (
('obreros', 'Obreros'),
('trabajadores', 'Trabajadores'),
('ejecutivo', 'Ejecutivo'),
)
cod_prenomina = models.AutoField(unique=True, primary_key=True)
tipo = models.CharField(choices=PG, max_length=30, default='trabajadores')
descripcion = models.CharField(max_length=20, blank=True, null=True)
pagos_empleados = models.ManyToManyField(PagoEmpleado)
fecha_inicio = models.DateField(blank=True, null=True)
fecha_final = models.DateField(blank=True, null=True)
Я не знаю, как представлять все данные в отношениях, заказанных администратором. Я прочитал документацию по django, но я не смог составить представление, есть ли полный пример, который мне поможет?