+self to string

This commit is contained in:
jp.av.dev 2020-11-13 01:18:02 -03:00
parent afd417c728
commit 31bc6798fe

View File

@ -12,7 +12,9 @@ class Articulos(models.Model):
nombre = models.CharField(max_length=30)
seccion = models.CharField(max_length=20)
precio = models.IntegerField()
def __str__(self):
return 'Nombre: %s, Depto. %s, Precio $ %s' % (self.nombre, self.seccion, self.precio)
class Pedidos (models.Model):
numero = models.IntegerField()