a Django-based indieweb.org site https://00dani.me/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
751 B

from django.db import models
from entries.models import Entry
from model_utils.models import TimeStampedModel
class State:
PENDING = 'p'
VALID = 'v'
INVALID = 'i'
DELETED = 'd'
CHOICES = (
(PENDING, 'pending'),
(VALID, 'valid'),
(INVALID, 'invalid'),
(DELETED, 'deleted'),
)
class Webmention(TimeStampedModel):
entry = models.ForeignKey(Entry, on_delete=models.CASCADE)
source = models.CharField(max_length=255)
target = models.CharField(max_length=255)
state = models.CharField(
choices=State.CHOICES,
default=State.PENDING,
max_length=1
)
class Meta:
default_related_name = 'mentions'
unique_together = ('source', 'target')