On Fri, Jan 1, 2010 at 5:26 AM, Continuation <[email protected]> wrote: > From reading several posts here, it looks like it's not a good idea to > try to have ForeignKey pointing from 1 DB to another DB. > > The problem for me is that pretty much every single model of mine has > a link to User. And I suspect that's a very common case for most > people. > > If I put in FK to User in my models, I wouldn't be able to have > multidb. > > One workaround I can think of is to have an IntegerField pointing to > User.id instead of a FK to User. > > Is that a good alternative? Or is it going to cause more problems that > it's worth?
It is *an* alternative. On the plus side, it will let you store the PK value of the remote object. On the negative side, it won't automatically resolve related objects in the same way that a foreign key will, and it won't display a helpful widget in forms. There is at least one active thread discussing approaches to this problem; I suggest you read up on the suggestions contained in that thread. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

