diff options
author | luxagraf <sng@luxagraf.net> | 2011-01-20 12:25:33 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2011-01-20 12:25:33 -0500 |
commit | 40fdd2a51a8ef3eaa9571970ca0cd440d60ce762 (patch) | |
tree | 1b5ae42cba6d47c7be9725c1fdd0f9a7935f38dc /apps | |
parent | 205fc827ef1dd21acc95139fca57651c9baccb2d (diff) |
started work on nat parks proj css, plus changed GA scripts
Diffstat (limited to 'apps')
-rw-r--r-- | apps/blog/models.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/blog/models.py b/apps/blog/models.py index 7b01eb7..85f105f 100644 --- a/apps/blog/models.py +++ b/apps/blog/models.py @@ -19,6 +19,10 @@ def get_upload_path(self, filename): def get_tn_path(self, filename): return "images/post-thumbnail/%s/%s" %(datetime.datetime.today().strftime("%Y"), filename) +def image_url_replace(str): + str = str.replace('[[base_url]]', settings.IMAGES_URL) + print str + return str def markdown_processor(md): processed = markdown.markdown(md, ['footnotes'],safe_mode = False).split('<break>') @@ -119,7 +123,8 @@ class Entry(models.Model): return '%spost-images/%s/%s' %(settings.IMAGES_URL, image_dir, img) def save(self): - html,lede = markdown_processor(self.body_markdown) + md = image_url_replace(self.body_markdown) + html,lede = markdown_processor(md) self.body_html = html self.lede = lede self.dek == markdown.markdown(self.dek, safe_mode = False) |