FollowRequest model

This commit is contained in:
Eliot Berriot 2018-04-04 19:38:28 +02:00
parent 3ad1fe17d5
commit b833a11fb6
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 46 additions and 0 deletions

View file

@ -103,3 +103,21 @@ class Follow(models.Model):
def get_federation_url(self):
return '{}#follows/{}'.format(self.actor.url, self.uuid)
class FollowRequest(models.Model):
uuid = models.UUIDField(default=uuid.uuid4, unique=True)
actor = models.ForeignKey(
Actor,
related_name='emmited_follow_requests',
on_delete=models.CASCADE,
)
target = models.ForeignKey(
Actor,
related_name='received_follow_requests',
on_delete=models.CASCADE,
)
creation_date = models.DateTimeField(default=timezone.now)
last_modification_date = models.DateTimeField(
default=timezone.now)
approved = models.NullBooleanField(default=None)