Author: batiste.bieler
Date: Tue Feb 17 04:09:21 2009
New Revision: 350
Modified:
trunk/pages/models.py
trunk/pages/templates/admin/pages/page/menu.html
Log:
Add template high level cache for the admin
Modified: trunk/pages/models.py
==============================================================================
--- trunk/pages/models.py (original)
+++ trunk/pages/models.py Tue Feb 17 04:09:21 2009
@@ -103,8 +103,11 @@
self.invalidate_if_parent_changed()
cache.delete(self.PAGE_LANGUAGES_KEY % (self.id))
+ cache.delete("page_row_admin:%d" % (self.id))
+
for desc in self.get_descendants():
- desc.invalidate_if_parent_changed()
+ cache.delete("page_row_admin:%d" % (desc.id))
+ #desc.invalidate_if_parent_changed()
if self.parent:
for site in self.parent.sites.all():
Modified: trunk/pages/templates/admin/pages/page/menu.html
==============================================================================
--- trunk/pages/templates/admin/pages/page/menu.html (original)
+++ trunk/pages/templates/admin/pages/page/menu.html Tue Feb 17 04:09:21
2009
@@ -1,9 +1,10 @@
{% load pages_tags i18n adminmedia cache %}
{% if has_permission %}
-<tr id="page-row-{{ page.id }}" class="child-of-{{ page.parent.id }}">
+{% cache 10000 page_row_admin page.id %}
+<tr id="page-row-{{ page.id }}" class="child-of-{{ page.parent_id }}">
<td {% if level %}style="padding-left:{{level}}em"{% endif %}>
- <span id="move-target-{{ page.id }}" class="move-target-container"
style="display:none;float:right">
+ <span id="move-target-{{ page.id }}" class="move-target-container">
<a href="#" class="move-target left" title="{% trans "as left
sibling"%}"><img alt="" src="{%
admin_media_prefix %}img/admin/arrow-up.gif"/></a> |
<a href="#" class="move-target right" title="{% trans "as right
sibling"%}"><img alt="" src="{%
admin_media_prefix %}img/admin/arrow-down.gif"/></a></a> |
<a href="#" class="move-target first-child" title="{% trans "as
child"%}">↘</a>
@@ -48,6 +49,7 @@
{% endcache %}
</td>
</tr>
+{% endcache %}
{% endif %}
{% for child in children %}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---