Small fixes in the debug toolbar panel.
This commit is contained in:
parent
819cc14d0e
commit
c1f68ff557
|
@ -54,11 +54,12 @@ class CachalotPanel(Panel):
|
|||
data[db_alias].append(
|
||||
(model._meta.app_label, model.__name__, invalidation))
|
||||
if self.last_invalidation is None \
|
||||
or invalidation < self.last_invalidation:
|
||||
or invalidation > self.last_invalidation:
|
||||
self.last_invalidation = invalidation
|
||||
data[db_alias].sort(key=lambda row: row[2], reverse=True)
|
||||
self.record_stats({'invalidations_per_db': data.items()})
|
||||
|
||||
@property
|
||||
def nav_subtitle(self):
|
||||
if self.enabled and self.last_invalidation is not None:
|
||||
return (_('Last invalidation: %s')
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% load i18n %}
|
||||
|
||||
{% for db_alias, invalidations in invalidations_per_db %}
|
||||
<h3>{% blocktrans %}Database '{{ db_alias }}'{% endblocktrans %}</h3>
|
||||
<h4>{% blocktrans %}Database '{{ db_alias }}'{% endblocktrans %}</h4>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
|
|
Loading…
Reference in New Issue