summaryrefslogtreecommitdiff
path: root/ishtar_common/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/utils.py')
-rw-r--r--ishtar_common/utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py
index fa98549ba..0c4d217d6 100644
--- a/ishtar_common/utils.py
+++ b/ishtar_common/utils.py
@@ -164,6 +164,17 @@ def cached_label_changed(sender, **kwargs):
cached_label_changed(item.__class__, instance=item)
+def regenerate_all_cached_labels(model):
+ """
+ When the rule for generating cached label change. Regeneration of all
+ label has to be done.
+ :param model: model class conecrned
+ """
+ for item in model.all():
+ item.skip_history_when_saving = True
+ cached_label_changed(model, instance=item)
+
+
SHORTIFY_STR = ugettext(" (...)")