Mercurial > hg-website
diff hgscm/apps/www/models.py @ 71:9be94f3dcaa0
downloads: fix import and paths
author | David Soria Parra <dsp@php.net> |
---|---|
date | Wed, 18 Feb 2009 15:46:23 +0100 |
parents | bef09338eceb |
children | 8d25e34c21c2 |
line wrap: on
line diff
--- a/hgscm/apps/www/models.py Wed Feb 18 15:32:57 2009 +0100 +++ b/hgscm/apps/www/models.py Wed Feb 18 15:46:23 2009 +0100 @@ -1,9 +1,11 @@ from django.db import models from django.utils import simplejson +from django.conf import settings +import os def get_download(platform, version): '''get the download for the right version''' - f = open('downloads.json') + f = open(os.path.join(settings.MEDIA_ROOT, "downloads.json")) list = simplejson.load(f) f.close() latest = version == 'latest' or not version @@ -14,7 +16,7 @@ return version['url'] def get_latest_version(): '''return the latest available version''' - f = open('downloads.json') + f = open(os.path.join(settings.MEDIA_ROOT, "downloads.json")) list = simplejson.load(f) f.close() for entry in list: