1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

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

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.