2022-11-05 16:51:54 -07:00
|
|
|
from django.db import models
|
|
|
|
|
|
|
|
|
|
|
|
class Follow(models.Model):
|
|
|
|
"""
|
2022-11-06 12:48:04 -08:00
|
|
|
When one user (the source) follows other (the target)
|
2022-11-05 16:51:54 -07:00
|
|
|
"""
|
|
|
|
|
|
|
|
source = models.ForeignKey(
|
|
|
|
"users.Identity",
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
related_name="outbound_follows",
|
|
|
|
)
|
|
|
|
target = models.ForeignKey(
|
|
|
|
"users.Identity",
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
related_name="inbound_follows",
|
|
|
|
)
|
|
|
|
|
|
|
|
note = models.TextField(blank=True, null=True)
|
|
|
|
|
|
|
|
created = models.DateTimeField(auto_now_add=True)
|
|
|
|
updated = models.DateTimeField(auto_now=True)
|