title: Copying a Django Field description from an existing Model to a new one
body: <p>I'm trying to dynamically generate a new Model, based on fields from an existing Model. Both are defined in <code>/apps/main/models.py</code>. The existing model looks something like this:</p>
  
  <pre><code>from django.db import models
  
  class People(models.Model):
      name = models.CharField(max_length=32)
      age = models.IntegerField()
      height = models.IntegerField()
  </code></pre>
  
  <p>I have a list containing the names of fields that I would like to copy:</p>
  
  <pre><code>target_fields = ["name", "age"]
  </code></pre>
  
  <p>I want to generate a new model the has all of the Fields named in <code>target_fields</code>, but in this case they should be indexed (<code>db_index = True</code>).</p>
  
  <p>I originally hoped that I would just be able to iterate over the class properties of <code>People</code> and use <code>copy.copy</code> to copy the field descriptions that are defined on it. Like this:</p>
  
  <pre><code>from copy import copy
  
  d = {}
  for field_name in target_fields:
      old_field = getattr(People, field_name) # alas, AttributeError
      new_field = copy(old_field)
      new_field.db_index = True
      d[field_name] = new_field
  
  IndexedPeople = type("IndexedPeople", (models.Model,), d)
  </code></pre>
  
  <p>I wasn't sure if <code>copy.copy()</code>ing Fields would work, but I didn't get far enough to find out: the fields listed in the class definition don't aren't actually included as properties on the class object. I assume they're used for some metaclass shenanigans instead.</p>
  
  <p>After poking around in the debugger, I found some type of Field objects listed in <code>People._meta.local_fields</code>. However, these aren't just simple description that can be <code>copy.copy()</code>ed and used to describe another model. For example, they include a <code>.model</code> property referring to <code>People</code>.</p>
  
  <p>How can I create a field description for a new model based on a field of an existing model?</p>