Basic support for tracking entry syndication

This commit is contained in:
Danielle McLean 2017-10-25 13:45:33 +11:00
parent 5a4362b129
commit 9adbe012d6
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
4 changed files with 62 additions and 2 deletions

View file

@ -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']