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 11938,`to_field` does not function as expected.,David Cramer,nobody,"In lookups involving a `ForeignKey`, or a `ManyToMany` intermediary table using a `to_field` they fail due to looking for the primary key, rather than the field specified by `to_field`. For example: {{{ user = models.ForeignKey(User, to_field=""username"") # Fails SimpleModel.objects.get(user=self.user) }}}",,closed,"Database layer (models, ORM)",1.1,,duplicate,to_field,,Unreviewed,0,0,0,0,0,0