On Thursday, March 14, 2019 at 4:22:15 PM UTC+1, Chetan Ganji wrote:
>
> Why do you need to do any calculations in the model code? 
>
> I would do any calculations in the views and store them using models. That 
> will remove the getters and setters from model. 
> Everything should work fine then.
>
> Hope it helps.
>

No, nothing would work fine: in that case I would need to remember 
constantly to either copy the code to handle the behaviour or make a call 
to *a view* each time and in any place that handles those fields.
Plus the tests would need to check over and over for the same behaviour 
every time the field was involved.

I'm sorry, but it really doesn't help.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ed1853bb-402a-4688-9061-63054c44ce63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to