diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/blog/models.py | 7 | ||||
-rw-r--r-- | apps/blog/signals.py | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/blog/models.py b/apps/blog/models.py index 7ad415c..5ff6624 100644 --- a/apps/blog/models.py +++ b/apps/blog/models.py @@ -55,7 +55,7 @@ class Entry(models.Model): status = models.IntegerField(choices=PUB_STATUS, default=0) photo_gallery = models.ForeignKey(PhotoGallery, blank=True, null=True, verbose_name='photo set') thumbnail = models.FileField(upload_to=get_upload_path, null=True,blank=True) - title_keywords = models.CharField(max_length=200) + title_keywords = models.CharField(max_length=200, null=True, blank=True) class Meta: ordering = ('-pub_date',) @@ -81,7 +81,10 @@ class Entry(models.Model): return self.enable_comments and datetime.datetime.today() - datetime.timedelta(30) <= self.pub_date def get_thumbnail_url(self): - return '%s%s' %(settings.IMAGES_URL, self.thumbnail.url[33:]) + if settings.DEVELOPMENT == True: + return '%s%s' %(settings.IMAGES_URL, self.thumbnail.url[35:]) + else: + return '%s%s' %(settings.IMAGES_URL, self.thumbnail.url[33:]) def save(self): html,lede = markdown_processor(self.body_markdown) diff --git a/apps/blog/signals.py b/apps/blog/signals.py index 0f3c9c4..41025f1 100644 --- a/apps/blog/signals.py +++ b/apps/blog/signals.py @@ -8,7 +8,7 @@ from locations.models import Region,Country def update_recent(sender, instance, signal, *args, **kwargs): # Update recent entries static file model = get_model('blog', 'entry') - qs = {'object_list': model.objects.filter(status__exact=1).order_by('-pub_date')[1:6]} + qs = {'object_list': model.objects.filter(status__exact=1).order_by('-pub_date')[1:5]} c = Context(qs) t = render_to_string('includes/recent_entries_template.html',c) fpath = '%s%s' %(settings.PROJ_ROOT,'templates/includes/recent_entries.html') |