From 64b86549829c7b2987707a13e92fa43e3834de97 Mon Sep 17 00:00:00 2001 From: lxf Date: Thu, 29 May 2014 14:22:46 +0000 Subject: bugs fixes and changed image urls to use https --- app/projects/models/base.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app/projects/models/base.py') diff --git a/app/projects/models/base.py b/app/projects/models/base.py index 51379a0..f0cd6d0 100644 --- a/app/projects/models/base.py +++ b/app/projects/models/base.py @@ -1,6 +1,7 @@ import datetime from django.contrib.gis.db import models from django.contrib.sitemaps import Sitemap +from django.conf import settings import markdown @@ -37,12 +38,17 @@ class Project(models.Model): '''Get the site's latitude.''' return self.point.y + @property + def get_project_image(self): + return "%s%s" % (settings.IMAGES_URL, self.image.name[7:]) + + class Meta: ordering = ('-pub_date',) get_latest_by = 'pub_date' app_label = 'projects' - def __unicode__(self): + def __str__(self): return self.title def get_absolute_url(self): @@ -58,6 +64,7 @@ class Project(models.Model): class ProjectSitemap(Sitemap): changefreq = "monthly" priority = 0.5 + protocol = "https" def items(self): return Project.objects.filter(status=1) -- cgit v1.2.3-70-g09d2