title: Django ManyToOne?
body: <p>I have an inventory management application, and inside is an <code>Item()</code> class that represents the product. All of the devices will be serialized so there will be a class later that represents each device called <code>OnHand()</code>.</p>
  
  <p><strong>Item Model</strong></p>
  
  <pre><code>class Item(models.Model):
      name = models.CharField(max_length=100)
      description = models.CharField(max_length=100)
      manufacturer = models.ForeignKey('Manufacturer', blank=True, null=True, on_delete=models.SET_NULL)
      introduction = models.DateField(auto_now=True)
      quanity = models.IntegerField(default=0)
      is_retired = models.BooleanField(default=False)
      tags = models.ManyToManyField(Tag)
  
      def __str__(self):
          return self.name
  
      def add(self):
          pass
  
      def remove(self):
          pass
  
      def retire(self): # Rex came up with this, roll credits.
          pass 
  
      def count(self):
          pass
  </code></pre>
  
  <p>I want an attribute for <strong>on_hand</strong> that has a <strong>ManyToOne</strong> type relationship.</p>
  
  <p><strong>OnHand Model Concept</strong></p>
  
  <pre><code>class OnHand(models.Model):
      name = models.CharFiled(max_length=100)
      serial = models.CharField(max_length=80)
      asset = models.CharField(max_length=20)
  
      def __str__(self):
          return self.serial
  </code></pre>
  
  <p>When creating a new <strong>OnHand</strong> object, I'd like to associate it with the <strong>Item</strong>. How would I go about doing this?</p>
  
  <p><strong>Structural Example</strong></p>
  
  <ul>
  <li>Item
  
  <ul>
  <li>Name = MacBook Pro</li>
  <li>Description = 15.5" MacBook Pro</li>
  <li>OnHand
  
  <ul>
  <li>serial number, asset tag</li>
  <li>serial number, asset tag</li>
  <li>serial number, asset tag</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p><strong>Current Test Code</strong></p>
  
  <pre><code>def make_macbook():
      """ Create a Manufacturer for Apple """
      apple = Manufacturer(name='Apple', rep_name='Jason Wilburn', support_number='1-800-Apple')
      apple.save()
      print('Manufacturer name: {}'.format(apple))
  
      """ Create a Category for Laptops """
      laptop = Category(name='Laptops')
      laptop.save()
      print('Category name: {}'.format(laptop))
  
      """ Create a Tag for Mac """
      mac = Tag(title='mac')
      mac.save()
      print('Tag name: {}'.format(mac))
  
      """ Create a MacBook Item """
      macbook = Item(name='Macbook Pro', description='15.5" Macbook Pro, 2018 Model', manufacturer=apple)
      macbook.save()
      print('Item name: {}'.format(macbook))
  
      """ Create a MacBook OnHand item """
      newMac = OnHand(name='MacBook Pro 15.5"', serial='SC02XP0NRJGH5', asset='DEPSC02XP0NRJGH5', product=macbook)
      newMac.save()
  
      """ Add to Item's OnHand """
  </code></pre>
  
  <p>Now I'm mainly just stuck on adding to the <strong>Item()</strong> OnHand to create the relationship.</p>