News for hackers. Stuff that matters.
Re:Things I Wish I Had Known About Django Development Before... by jdunck on Wednesday April 17, 2013 @08:44PM (#5568306)
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.)

There are no comments on this comment yet.