﻿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
8648	Admin ignores to_field on ForeignKey	Karen Tracey	nobody	"As reported here: http://groups.google.com/group/django-users/browse_thread/thread/47d31f56c1924cfa#

With current (I'm running [8661]) admin, for a model specified like so:

{{{
class Inventory(models.Model):
   barcode = models.PositiveIntegerField(unique=True)
   parent = models.ForeignKey('self', to_field='barcode', blank=True, null=True)
   name = models.CharField(blank=False, max_length=20)
   def __unicode__(self):
      return self.name
}}}

The admin treats 'parent' as though it refers to the pk field, not the barcode field.  

Old admin (0.96) handled this properly, that is it showed information for the related model that matched on the barcode field, not the pk field.


"		closed	contrib.admin	dev		fixed		django@…	Accepted	1	0	0	0	0	0
