title: Dynamically update ModelForm's Meta class
body: <p>I am hoping to dynamically update a ModelForm's inline Meta class from my view. Although this code seems to update the exclude list in the Meta class, the output from <code>as_p()</code>, <code>as_ul()</code>, etc does not reflect the updated Meta exclude.</p>
  
  <p>I assume then that the html is generated when the ModelForm is created not when the <code>as_*()</code> is called. Is there a way to force the update of the HTML? </p>
  
  <p>Is this even the best way to do it? I just assumed this <em>should</em> work.</p>
  
  <p>Thoughts?</p>
  
  <pre><code>from django.forms import ModelForm
  
  from testprogram.online_bookings.models import Passenger
  
  class PassengerInfoForm(ModelForm):
  
      def set_form_excludes(self, exclude_list):
          self.Meta.exclude = excludes_list
  
      class Meta:
          model = Passenger
          exclude = []
  </code></pre>