title: django - having model class how to get list of all fields, their types and parameters passed?
body: <p>lets assume I have following model:</p>
  
  <pre><code>class Note(models.Model):
      user = models.ForeignKey(User)
      pub_date = models.DateTimeField()
      title = models.CharField(max_length=200)
      body = models.TextField()
  
      def __unicode__(self):
          return self.title
  </code></pre>
  
  <p>I need a function that will work like this:</p>
  
  <pre><code>print inspectModelClass(Note)
  
  &gt;&gt;&gt; {user:('ForeignKey', {null:False, unique:False, blank:False...}), pub_date:('DateTimeField',{null:False, unique:False,...})...}
  </code></pre>
  
  <p>I don't know how to list only instances of django.model.field, how to get their names, proper types (BooleanField, CharField, etc.) and their properties like null, unique, max_chars etc.</p>
  
  <p>Can you help me with that?</p>
  
  <p>The reason I need this is that having such a function I would be able to dynamically create Index classes for django-haystack.</p>