title: Django class based DeleteView check constraints
body: <p>In a django application, there are two model with 1-M relationship, e.g. <code>Parent</code> and <code>Child</code>. I need to delete the Parent model object using <code>DeleteView</code> class. Before deleting the object, I need to check if it has any child objects and if there was, it returns an error message instead of deleting the object.
  Currently my DeleteView, like the default is:</p>
  
  <pre><code>class ParentDeleteView(DeleteView):
      model = Parent
      def get_success_url(self):
          return reverse_lazy('parent-list')
  </code></pre>
  
  <p>Which methods should I implement to check constraints?</p>