id,summary,reporter,owner,description,type,status,component,version,severity,resolution,keywords,cc,stage,has_patch,needs_docs,needs_tests,needs_better_patch,easy,ui_ux 7716,select_related() with nullable ForeignKeys screws up when rows actually have a null value,miracle2k,Malcolm Tredinnick,"{{{ class Review(models.Model): author = models.ForeignKey(Person, blank=True, null=True) }}} {{{ >>> Review.objects.filter(author__isnull=True)[0].author None >>> Review.objects.select_related('author').filter(author__isnull=True)[0].author : coercing to Unicode: need string or buffer, NoneType found >>> r = Review.objects.select_related('author').filter(author__isnull=True)[0] >>> type(r.author) }}}",,closed,"Database layer (models, ORM)",dev,,fixed,,,Accepted,0,0,0,0,0,0