Howdy -- On Tue, Mar 22, 2011 at 5:17 AM, dy <yang.den...@gmail.com> wrote: > # model in app test2,store to test2 > class Test2(models.Model): > name = models.CharField(max_length=30,verbose_name="test2") > test1 = > models.ForeignKey('test1.Test1',verbose_name="FK_test1",blank=True,null=True)
Just to be sure I'm reading this right: you want this field to be a foreign key from Test2, stored on the "test2" database, to the Test1 model stored on the "default" database? If so, this simply isn't supported by Django. You can't have foreign keys between tables on two different databases. If you think about about the underlying database and what a foreign key reference really is that should make sense. There's a few workarounds (like an IntegerField and some manual tracking of related IDs), but Django doesn't support this. I'm sorry that it worked at all in the first place; it never should have. Jacob -- 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.