Customized to allow multiple foreign keys on a given model

Still only two models allowed.