I haven’t tried this, but it seems that since Django 1.0 you can do something like:
class Foo(models.Model):
foo = models.ForeignKey(Bar, to_field='bar')
Documentation for this is here.
I haven’t tried this, but it seems that since Django 1.0 you can do something like:
class Foo(models.Model):
foo = models.ForeignKey(Bar, to_field='bar')
Documentation for this is here.