title: django-mptt - How to set different models in the same tree
body: <p>I would like to have a tree that would mimic a file system with folders and files. Folders and files would be defined by different models with different fields attributes.</p>
  
  <p>models:</p>
  
  <pre><code>from mptt.models import MPTTModel, TreeForeignKey
  
  class Folder(MPTTModel):
      parent = TreeForeignKey('self', null=True, blank=True, related_name='children')
      name = models.CharField(max_length=50)
      type = models.CharField(max_length=50)
  
  class File(MPTTModel):
      parent= TreeForeignKey(Document)
      filename = models.CharField(max_length=255)
      encoding = models.CharField(max_length=20)
      date_created = models.DateTimeField(auto_now_add=True)
      date_updated = models.DateTimeField(auto_now=True)
  </code></pre>
  
  <p>Creating some folders and files:</p>
  
  <pre><code> from shapefile.models import Folder, File
   root = Folder.objects.create(name="Root")
   download = Folder.objects.create(name="Download", parent=root)
   upload = Folder.objects.create(name="Upload", parent=root)
   File.objects.create(filename="Test", encoding="UTF-8", parent=download)
  </code></pre>
  
  <p>Shoul have:</p>
  
  <pre><code>&gt; Root
  &gt; --Download
  &gt; ----Test
  &gt; --Upload
  </code></pre>
  
  <p>How can I retrieve this tree in view and template?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Files are not inserted as folder's nodes:</p>
  
  <pre><code>file = File.objects.get(filename="Test")
  file.get_ancestors()
  &gt;&gt;&gt; []
  </code></pre>