title: Django Class Based View: Validate object in dispatch
body: <p>Is there a established way that i validate an object in the dispatch without making an extra database call when <code>self.get_object()</code> is called later in get/post?</p>
  
  <p>Here is what i have so far (slightly altered for this question):</p>
  
  <pre><code>class CourseUpdateView(UpdateView):
      def dispatch(self, request, *args, **kwargs):
  
          self.request = request
          self.kwargs = kwargs
          self.object = self.get_object()
  
          if self.object.is_online:
              messages.warning(request, "Sorry this one can't be updated")
              return redirect("course:detail", pk=self.kwargs['pk'])
  
          # this is going to call self.get_object again isn't it?
          return UpdateView.dispatch(self, request, *args, **kwargs)
  </code></pre>