title: python dynamically create class with inner class
body: <p>I'm using django-tastypie and I need to create classes like this from my django models:</p>
  
  <pre><code>class MyModelResource(ModelResource):
      class Meta:
          queryset = MyModel.objects.all()
          allowed_methods = ['get']
  </code></pre>
  
  <p>Since I have a lot of models in my django app I don't want to repeat myself, and use type() function instead to create all that resource classes. The problem is I don't know how to deal with this inner "Meta" class. </p>
  
  <p>Can you give me an example of how to dynamically create a class with inner class using type()?</p>