title: coercing to Unicode: need string or buffer, NoneType found
body: <p>I am making an Ajax request into views as follows:</p>
  
  <pre><code>def all_json_models(request):
      data = {}
      try:
  
      isp = request.GET['status']
      present_isp =  Priority.objects.filter(ispname = isp)
      isp_count = MultiWAN.objects.all()
  
    #  data['latest_no_rules']  =   latest_no_rules
      #data['present_isp']  = present_isp
      data['isp_count'] = isp_count
  
      return HttpResponse(simplejson.dumps(data))   
  </code></pre>
  
  <p>my <code>models.py</code> is like</p>
  
  <pre><code>class MultiWAN(models.Model):
  
      isp_name = models.CharField(max_length=10)
      description  = models.TextField(null=True)
      ip_address   = models.IPAddressField(null=True)
      subnet       = models.IPAddressField(null=True)
      gateway      = models.IPAddressField(null=True)
      nameserver   = models.ForeignKey('NameServer')
      weight       = models.IntegerField(null=False)
      interface    = models.CharField(max_length=5) 
      def __unicode__(self):
          """
          This function is to return the values we required.
          Arguments:
          - `self`:
          """
        #  return u'%s ' % (self.isp_name)
  
  
  class NameServer(models.Model):
      """  A Isp can have more than one nameserver so far we are declearing a seperate table 
      """         
      name = models.IPAddressField(null=False)    
  
  
  
  
  class Priority(models.Model):  
      priority =  models.IntegerField(null = True)
      ispname = models.ForeignKey('MultiWAN')
      rule = models.CharField(max_length=5,null=False)
      From  =    models.IPAddressField(null=True)
      To = models.IPAddressField(null=True)
      def __unicode__(self):
                        return u'%s ' % (self.priority)
  </code></pre>
  
  <p>while making request i am getting the error:</p>
  
  <pre><code>"coercing to Unicode: need string or buffer, NoneType found"
  </code></pre>
  
  <p>What i am doing wrong here?</p>