Added trust model

This commit is contained in:
Nicolas Margulies 2021-09-05 14:13:27 +02:00 committed by Yohann D'ANELLO
parent bd4fb23351
commit 7ab0fec3bc
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 23 additions and 0 deletions

View File

@ -217,6 +217,29 @@ class NoteSpecial(Note):
return self.special_type
class Trust(models.Model):
"""
A one-sided trust relationship bertween two users
If another user considers you as your friend, you can transfer money from
them
"""
trusting = models.ForeignKey(
Note,
on_delete=models.CASCADE,
related_name='trusting',
verbose_name=('trusting')
)
trusted = models.ForeignKey(
Note,
on_delete=models.CASCADE,
related_name='trusted',
verbose_name=('trusted')
)
class Alias(models.Model):
"""
points toward a :model:`note.NoteUser` or :model;`note.NoteClub` instance.