File diff 8e6ea8ad71bf → f7e45da6ddc8
Show inline comments
from django.db import models
from django.conf import settings
from sflc.apps.staff.models import Person
from import Event
from conservancy.apps.staff.models import Person
from import Event
from django.contrib.sites.models import Site
from datetime import datetime, timedelta

class PressRelease(models.Model):
    """News release model"""

@@ -34,17 +34,17 @@ class PressRelease(models.Model):
    def is_recent(self):
        return self.pub_date > ( - timedelta(days=5))
        # question: does do a syscall each time is it called?

    def is_in_past_month(self):
        # This function is deprecated.  Use the date_within template
        # filter instead (example in sflc/templates/frontpage.html)
        # filter instead (example in conservancy/templates/frontpage.html)
        return self.pub_date > ( - timedelta(days=30))

    def save(self):
        if settings.SFLC_DEVEL or True:
        if settings.CONSERVANCY_DEVEL or True:
            super(PressRelease, self).save()

        blog_name = 'Software Freedom Law Center News'
        blog_url =  ''
        post_url = (''
@@ -75,13 +75,13 @@ class ExternalArticleTag(models.Model):

class PublicExternalArticleManager(models.Manager):
    def get_query_set(self):
        return super(PublicExternalArticleManager, self).get_query_set().filter(visible=True)

class ExternalArticle(models.Model):
    """A system for displaying SFLC news mentions on the site.
    """A system for displaying Conservancy news mentions on the site.

    (Currently unused)

    title = models.CharField(max_length=400)
    info = models.CharField(help_text="subscribers only? audio? pdf warning?",