Re: Validation on two user foreign keys

2015-01-28 Thread Bala Subrahmanyam Varanasi
Hi Nicole, Override the Friendship model's 'save' method to test the unique combination of (initiator, recipient). Regards, On 29 January 2015 at 08:27, Nicole Harris wrote: > Hi All, > > I have a model called 'Friendship' that includes two foreign keys to > User. One is the 'initiator' of th

Validation on two user foreign keys

2015-01-28 Thread Nicole Harris
Hi All, I have a model called 'Friendship' that includes two foreign keys to User. One is the 'initiator' of the Friendship, the other the 'recipient'. I want to make sure the Friendship only exists once regardless of who is the recipient and who is the initiator. Any thoughts on the best way