2009/5/16 <lokeshmarema...@gmail.com>: > > Hi All, > > Need help in creating foreign key column in a table. > > In the below model I would like to create a foreign key for the field > 'new_foreign_col' which should refer to 'username' column (non primary > column) from auth_user table. > > class details(models.Model): > new_foreign_col = ???????? >
http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey Check: ForeignKey.to_field Hope it helps! -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---