You can use @property

On Sat, 19 Sep 2020, 20:45 eankomah, <csceanko...@gmail.com> wrote:

> I have two fields:
>     quantity = models.FloatField()
>     unit_price = models.FloatField()
>
> and i want ot do someting like this
>
>
>     total_price = models.FloatField('unit_price' * 'quantity')
>
> Thanks
>
> --
> 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/a7844b0c-1db7-4c13-911d-e2e80e9a7bf6n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a7844b0c-1db7-4c13-911d-e2e80e9a7bf6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAGyqUuXJx3gesby7EE7s8%2Bvsk2WP9azTFoHoT2y8Y6hMJsoS6A%40mail.gmail.com.

Reply via email to