Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Commit

Permalink
Add caching to detail template
Browse files Browse the repository at this point in the history
  • Loading branch information
hedleyroos committed Apr 8, 2013
1 parent d384b54 commit dd5e1fd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
@@ -1,6 +1,10 @@
Changelog
=========

next
----
#. Add caching to detail template.

0.1.6
-----
#. Do not show main image if images uploaded via CKEditor.
Expand Down
19 changes: 11 additions & 8 deletions post/templates/post/inclusion_tags/post_detail.html
@@ -1,12 +1,15 @@
{% extends "jmbo/inclusion_tags/modelbase_detail.html" %}
{% load cache %}

{% block content %}
{% if '<img' not in object.content %}
<div class="image">
<img src="{{ object.image_detail_url }}" />
</div>
{% endif %}
<div class="content">
{{ object.content|safe }}
</div>
{% cache 3600 'object_detail_inclusion' object.id object.modified %}
{% if '<img' not in object.content %}
<div class="image">
<img src="{{ object.image_detail_url }}" />
</div>
{% endif %}
<div class="content">
{{ object.content|safe }}
</div>
{% endcache %}
{% endblock %}

0 comments on commit dd5e1fd

Please sign in to comment.