Quantcast
Channel: Planet Python
Viewing all articles
Browse latest Browse all 22462

Alexey Evseev: Django: signal or model method?

$
0
0

Django: signal or model method?

When I needed to implement some functionality on model saving, I always asked a question to myself - where to place it. In signal or in model method save()? Let's see, what and when is more applicable.

When use model methods save(), delete()?

To my mind class methods are more usable, if logic concerns exclusively current model. For example, fill some field on model saving according to data from other fields.

Some people say, that ...


Viewing all articles
Browse latest Browse all 22462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>