You can't define a foreign key as unique_together but there might be a way of overriding that. But I don't think that'll work. If you set primary as unique together, they'll only be able to have two names: one where primary is True and only one where primary is False.