diff options
Diffstat (limited to 'app/syndication/models.py')
-rw-r--r-- | app/syndication/models.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/syndication/models.py b/app/syndication/models.py new file mode 100644 index 0000000..5856de1 --- /dev/null +++ b/app/syndication/models.py @@ -0,0 +1,27 @@ +from django.db import models +from django.contrib.contenttypes.models import ContentType +from django.contrib.contenttypes.fields import GenericForeignKey + + +class Syndicate(models.Model): + name = models.CharField(max_length=200) + + def __str__(self): + return self.name + + +class SyndicatedItem(models.Model): + content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) + object_id = models.PositiveIntegerField() + content_object = GenericForeignKey('content_type', 'object_id') + syndicate = models.ManyToManyField(Syndicate) + publish_date = models.DateTimeField() + STATUS = ( + ('1', "Unsent"), + ('2', "Sent"), + ) + status = models.CharField(max_length=1, choices=STATUS, null=True, blank=True) + rel_link = models.CharField(max_length=300, null=True, blank=True) + + def __str__(self): + return self.content_object.title |