diff options
author | lxf <lxf@d1stkfactory> | 2014-05-29 14:22:46 +0000 |
---|---|---|
committer | lxf <lxf@d1stkfactory> | 2014-05-29 14:22:46 +0000 |
commit | 64b86549829c7b2987707a13e92fa43e3834de97 (patch) | |
tree | ab9cccba12e02714c1e29850af0d626b51474b17 /app/projects/models/base.py | |
parent | d6379dbc06393d286eedfd19c842f824100f2968 (diff) |
bugs fixes and changed image urls to use https
Diffstat (limited to 'app/projects/models/base.py')
-rw-r--r-- | app/projects/models/base.py | 9 |
1 files changed, 8 insertions, 1 deletions
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) |