If you go with the current solution, you will have to add the to_field keyword argument to ForeignKey:
clinician = models.ForeignKey(Clinician, to_field='name') Best, Gergely 2015-11-05 15:47 GMT+01:00 frocco <faro...@gmail.com>: > Thanks, I will look into adding id > > If I just do this, clinician = models.ForeignKey(Clinician) > I get clinician_id does not exist > > In my related table I have > > def __unicode__(self): > return self.clinicianname > > > On Wednesday, November 4, 2015 at 11:19:40 AM UTC-5, frocco wrote: >> >> Hello, >> >> I have two existing tables >> table1 has name1 >> >> table2 has name2 >> >> when I edit table2 in admin, I want a dropdownbox that shows values from >> table1 using name1 >> both fields are character >> >> I cannot change the design, porting from msaccess >> >> thanks >> >> -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/44660e3a-cd6c-4858-8b29-d1dc4ceeced0%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/44660e3a-cd6c-4858-8b29-d1dc4ceeced0%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACczBULUX9nMhjMFgM54ZQ3CZiNNZPLTjBeidO9-f%2BVzR30zGw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.