title: Django AttributeError and query does not exist error
body: <p>File "C:\Users\NICSI\Desktop\lastnow\mynew\cheque\models.py", line 39, in <strong>st
  r</strong>
      return (self.related.relation.username).title()
  AttributeError: 'NoneType' object has no attribute 'relation'
  [28/Sep/2018 12:36:49] "GET /admin/cheque/mycheque/ HTTP/1.1" 500 301999
  Exception Value:<br>
  Signs matching query does not exist.
  DJANGO throw these two errors how could i resolve this to show the relation between user and these details
      <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>models.py
  class Signs(models.Model):
       relation = models.OneToOneField(User, on_delete=models.CASCADE)
       department = models.CharField(null=True, blank=True, max_length=1000, help_text="User Department")
       mobile = models.CharField(null=True, blank=True, max_length=1000, help_text="User Mobile")
  
       
       def __str__(self):
        return (self.relation.username).title()
       class Meta:
         verbose_name_plural = "Registration Information"
      class Mycheque(models.Model):
       related = models.ForeignKey(Signs, on_delete=models.CASCADE, null=True, blank=True)
       to_pay = models.CharField(max_length=250, null=True, blank=True)
       amount = models.BigIntegerField(default=0, null=True, blank=True)
       amount_in_words = models.CharField(max_length=10000, null=True, blank=True)
       vouchar_no = models.BigIntegerField(default=0, null=True, blank=True)
       dated = models.DateTimeField(auto_now_add=True, null=True, blank=True)
       cheque_no = models.BigIntegerField(default=0, null=True, blank=True)
       cheque_date = models.CharField(max_length=10, null=True, blank=True)
       account_no = models.BigIntegerField(default=0, null=True, blank=True)
       
       def save(self):
         self.dated = datetime.now()
         super(Mycheque, self).save()
       
       def __str__(self):
        return (self.related.relation.username).title()
       class Meta:
         verbose_name_plural = "Single Cheque Of Users"
         </code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>views.py
      def mycheque(request):
        if request.method == "POST":
         userdata = User.objects.get(username = request.user)
         user_data = Signs.objects.get(relation_id=userdata.id)
         if userdata.check_password(passwd) == True:
          to_p = request.POST['topay']
          amnt = request.POST['amount1']
          amnt_in_words = request.POST['amount_string'] 
          vouch_no = request.POST['voucharno']
          d = request.POST['date'] 
          cheq_no = request.POST['chequeno']
          cheq_date = request.POST['chequedate']
          acc_no = request.POST['accountno']
          single = Mycheque(to_pay=to_p, amount=amnt, amount_in_words=amnt_in_words, vouchar_no=vouch_no, dated=d, cheque_no=cheq_no, cheque_date=cheq_date, account_no=acc_no)
          single.save()
          messages.success(request, "Your Cheque is created") 
           
        else:
         messages.error(request, "Please Try again...")
        return render(request, 'cheque/mycheque.html', {})   
         </code></pre>
  </div>
  </div>
  </p>