title: Model Design in Django
body: <p>I have many components and I want to have for each component a list where it shows which users have taken that component and how many of them?</p>
  <pre><code>class Component(models.Model):
      name=models.CharField(max_length=128,unique=False,blank=False)
      detail=models.TextField()
      max_num=models.IntegerField(default=0)
      issued_num=models.IntegerField(default=0)
  
      def __str__(self):
          return self.name
  
      def save(self,*args,**kwargs):
          super().save(args,kwargs)
  
      def available(self):
          return self.max_num-self.issued_num
  
  Status=((0,&quot;Pending&quot;),(1,&quot;Accepted&quot;),(2,&quot;Rejected&quot;))
  
  class Issued(models.Model):
      request_user=models.ForeignKey(User,on_delete=models.CASCADE)
      component=models.ForeignKey(Component,on_delete=models.CASCADE)
      status=models.IntegerField(choices=Status,default=0)
      request_num=models.IntegerField(default=0)
  
      def __str__(self):
          return self.component.name
  </code></pre>
  <p>I have come up with this solution where Issued model depending on status will be shown as request or will be treated confirmation for issue request depending on its status</p>
  <p>Can anyone please tell whether its right way to do it or if its not suggest database friendly design</p>