title: Django-mptt and multiple parents?
body: <p>I've been banging my head against the desk for a couple weeks on this problem, so I figure it may be time to seek some help.
  <p>I'm trying to implement a database structure which has hierarchical data of parts for assemblies. My main problem lies with trying to assign one "subassembly" to another "assembly"/tree. Refering to the example trees below- I have no problem creating and working with assembly 1 and 2. But when I make assembly 3, I get multiple objects returned errors when I call up the subassemblies (which I understand base on the way I'm attempting).</p>
  
  <pre><code>assembly 1:    assembly 2:     assembly 3:
  1.1            2.1             2.1
  - 1.1.1        - 2.1.1         - 2.1.1
  1.2            2.2             1.2
  - 1.2.1        - 2.2.1         - 1.2.1               
  </code></pre>
  
  <p>Here is the model I've been trying:</p>
  
  <pre><code>#models.py snippet
  class Part(models.Model):
          part_name = models.CharField(max_length=30, primary_key=True)
          description = models.TextField(max_length=500, blank=True, null=True)
          revision = models.CharField(max_length=10, blank=True, null=True)
  
          def __unicode__(self):
                  return u'%s' % (self.part_name)
  
  class Assembly(MPTTModel):
          name = models.ForeignKey(Part)
          parent = models.ForeignKey('self', null=True, blank=True, related_name='children')
  
          def __unicode__(self):
                  return u'%s' % (self.name)
  
  #views.py snippet
  def assembly_details(request, assembly_name):
          context_instance=RequestContext(request)
          assembly = Assembly.objects.get(name=assembly_name)
          descendants_list = assembly.get_descendants(include_self=False)
          return render_to_response('assembly_details.html', locals(), context_instance,)
  </code></pre>
  
  <p>So basically I'm creating very basic trees and linking to the more detailed data through the Part FK. I need to be able to query any assembly and look at it's descendants- so although I can call assembly 3, I can't call any of the children that have been in multiple trees.
  <p>For what I'm doing, from any given point in the tree, going down will always be the same, i.e. 1.2 will always have a child of 1.2.1, but going up can change, i.e 1.2 can have parents of 1 and/or 3.
  <p>The problem is having the Assembly.parent be a ForeignKey as it limits it to one value. Any ideas on some solutions or things to try?
  <p>Please let me know if you want to see additional code or ask questions. This seems to be a difficult subject to try to clearly explain! Thanks
  <br/>
  <p><strong>----EDIT----</strong>
  <p>I've figured out that I need a directed a-cyclic graph (DAG) model.
  <p>I don't have a specific solution yet, but when I figure it out or ask a DAG question, I'll try to post a link here.
  <p><br/>
  <strong>----EDIT 2----</strong></p>
  
  <p><p><a href="https://github.com/stdbrouw/django-treebeard-dag" rel="noreferrer">django-treebeard-dag</a>
  <p><a href="https://github.com/elpaso/django-dag" rel="noreferrer">django-dag</a>
  <p>I found these two very small projects. I was working with the "treebeard" version originally, then switched over to django-dag for my project. Feel free to PM with questions about basic usage, and I'll see if I can help.</p>