6 ms·
Regarding 15 - if you want that behavior, you'd be better off with using your own model subclass: class ValidatingModel(Model): def save(self, *args, **k
by jdunck 13y ago
Regarding 15 - if you want that behavior, you'd be better off with using your own model subclass:
class ValidatingModel(Model):
def save(self, *args, **kwargs):
self.full_clean()
super(ValidatingModel, self).save(*args, **kwargs)
Then inherit from that everywhere.
Signals have a not-insignificant overhead. They are most useful for tying together code that comes from different places. (If you want to do full validations on 3rd-party app models, then you might this signal approach, but it might also be a bug in the app that the hook isn't just there for you.)