Fix generation of foreign key URIs

Otherwise you just get the string rep of the model class