I think you have used the wrong name - "saveit" instead of "save" - also 
have a look at the example in the docs:
https://docs.djangoproject.com/en/3.2/topics/db/models/#overriding-predefined-model-methods
and see which parameters are needed for it.

On Saturday, 24 April 2021 at 20:50:15 UTC+2 encinas...@gmail.com wrote:

> Hi everyone i build a web application in Django 3.1.7 and i try to do the 
> next opeation(multiplication).
>
> in my models a have:
> class Articles(models.Model):
>      quantity = models.PositiveIntegerField()
>     cost_buy = models.DecimalField(max_digits=10, decimal_places=2)
>     total_todo = models.DecimalField(max_digits=10, decimal_places=3)
>
> @property
> def total_valores(self):
>      return (self.cost_buy*self.quantity)
>
> def saveit(self):
>     self.total_todo = self.total_valores
>     super (Articles, self).save()
> __________________________________________________________
>
> so, I was tried with this functions , but it's doesn't save anything
>
> would you give me some recomendations.
>
> Thank you very much in advance and I remain at your service regards 
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fb9b6d0f-18b6-4771-b812-a0644cb03806n%40googlegroups.com.

Reply via email to