Skip to content
Snippets Groups Projects
Verified Commit b833a11f authored by Eliot Berriot's avatar Eliot Berriot
Browse files

FollowRequest model

parent 3ad1fe17
No related branches found
No related tags found
No related merge requests found
# Generated by Django 2.0.3 on 2018-04-04 17:11
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
dependencies = [
('federation', '0003_auto_20180403_1921'),
]
operations = [
migrations.CreateModel(
name='FollowRequest',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('uuid', models.UUIDField(default=uuid.uuid4, unique=True)),
('creation_date', models.DateTimeField(default=django.utils.timezone.now)),
('last_modification_date', models.DateTimeField(default=django.utils.timezone.now)),
('approved', models.NullBooleanField(default=None)),
('actor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='emmited_follow_requests', to='federation.Actor')),
('target', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='received_follow_requests', to='federation.Actor')),
],
),
]
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment