Hi, I want to design a Task model that can be associated to Project Models, another X model, and other Task models. The obvious choice is a foreign key, but I want any particular instance of that Task model to only be associated to only one of those model types, that is, if a Task model has a relationship with a Project model, it cannot have a relationship with another Task model, and so on. Any advice in what would be the best way to represent this? Thanks.
A:
Have a look at Generic relation. It lets you define a foreign key on multiple models. This way your task is only linked to one of your models.
Eric Fortin
2010-10-28 13:18:52