estoy resien empezando a programar en django, y tengo el siguiente problema, les agradecería mucho su ayuda.
-- class Producto(models.Model):
codigo = models.CharField(max_length=10, unique=True) nombre = models.CharField(max_length=200, unique=True)
|
def preeciototal(self): precio_total=self.precio_compra*self.stock return precio_total
como lo aria en las vistas y no en el models.
mi problema es.
como saco el precio total que la lógica seria.
400*520=208000
500*1150=1650
600*1440=864000
208000+1650+864000=Precio total..
no se como hacerlo en las vistas..
Gracias..
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/97f5ff23-bc8f-4146-a74f-085493f92f65%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:
Post a Comment