Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Relationship(models.Model):
- person1 = models.ForeignKey(User, on_delete=models.CASCADE, related_name="person1")
- person2 = models.ForeignKey(User, on_delete=models.CASCADE, related_name="person2")
- notification = models.OneToOneField('Notification', null=True, blank=True, on_delete=models.SET_NULL)
- class Meta:
- unique_together = (('person1', 'person2'),)
- def __str__(self):
- return '%s with %s' % (self.person1.get_username(), self.person2.get_username())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement