title: django giving TypeError when using len() on a QuerySet
body: <p>I am programming a very simple application to store results of soccer matches, and I am stuck with the following problem. When running one of the unit tests, the following code:</p>
  
  <pre><code>listCompetition = Competition.objects.filter(compId=competitionId)
  if len(listCompetition) == 0:
     #some code here
  else:
     #some code here
  </code></pre>
  
  <p>gives the following error:</p>
  
  <pre><code>File "C:\Users\admin\workspace\project\src\bla\bla\module.py", line 222, in getMatches
     if len(listCompetition) == 0:
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 82, in __len__
     self._result_cache = list(self.iterator())
  File "C:\Python27\lib\site-packages\django\db\models\query.py", line 286, in iterator
     obj = model(*row[index_start:aggregate_start])
  TypeError: __init__() takes exactly 3 arguments (4 given)
  </code></pre>
  
  <p>However, if I substitute the first line of code by:</p>
  
  <pre><code>listCompetition = list(Competition.objects.filter(compId=competitionId))
  </code></pre>
  
  <p>then it works perfectly fine. Why does it behave in this strange way? How comes that Django is passing 4 parameters, if I have defined only two in the constructor of class Competition? If it helps, here is the model definition for class Competition:</p>
  
  <pre><code>class Competicion(MultiName):
     def __init__(self, canonicalName, compId):
        super(Competition, self).__init__(canonicalName, compId)
  
  class MultiName(models.Model):
     entId = models.CharField(null=True, max_length=25); 
     canonicalName = models.CharField(max_length=50, primary_key=True);
  
     def __init__(self, canonicalName, entId=None):
        super(MultiName, self).__init__()
        self.canonicalName = canonicalName;
        self.entId = entId;
  </code></pre>
  
  <p>Thank you very much.</p>