Basic support for tracking entry syndication
This commit is contained in:
parent
5a4362b129
commit
9adbe012d6
4 changed files with 62 additions and 2 deletions
|
|
@ -3,6 +3,7 @@ from django.db import models
|
|||
from django.urls import reverse
|
||||
from slugify import slugify
|
||||
|
||||
from users.models import Profile
|
||||
from . import kinds
|
||||
ENTRY_KINDS = [(k.id, k.__name__) for k in kinds.all]
|
||||
|
||||
|
|
@ -47,3 +48,16 @@ class Entry(models.Model):
|
|||
class Meta:
|
||||
verbose_name_plural = 'entries'
|
||||
ordering = ['-published']
|
||||
|
||||
|
||||
class Syndication(models.Model):
|
||||
entry = models.ForeignKey(
|
||||
Entry,
|
||||
related_name='syndications',
|
||||
on_delete=models.CASCADE
|
||||
)
|
||||
profile = models.ForeignKey(Profile, on_delete=models.CASCADE)
|
||||
url = models.CharField(max_length=255)
|
||||
|
||||
class Meta:
|
||||
ordering = ['profile']
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue