diff options
Diffstat (limited to 'archaeological_files/models.py')
| -rw-r--r-- | archaeological_files/models.py | 10 | 
1 files changed, 8 insertions, 2 deletions
| diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 42520769a..b116d1f1c 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -23,7 +23,7 @@ from django.conf import settings  from django.contrib.gis.db import models  from django.core.cache import cache  from django.db.models import Q, Count, Sum -from django.db.models.signals import post_save, m2m_changed +from django.db.models.signals import post_save, m2m_changed, post_delete  from django.utils.translation import ugettext_lazy as _, ugettext  from ishtar_common.utils import cached_label_changed, get_cache @@ -31,7 +31,7 @@ from ishtar_common.utils import cached_label_changed, get_cache  from ishtar_common.models import GeneralType, BaseHistorizedItem, \      HistoricalRecords, OwnPerms, Person, Organization, Department, Town, \      Dashboard, DashboardFormItem, ValueGetter, ShortMenuItem, \ -    OperationType, get_external_id +    OperationType, get_external_id, post_save_cache  from archaeological_operations.models import get_values_town_related, \      ClosedItem @@ -51,6 +51,8 @@ class FileType(GeneralType):              return file_type_id == preventive          except FileType.DoesNotExist:              return False +post_save.connect(post_save_cache, sender=FileType) +post_delete.connect(post_save_cache, sender=FileType)  class PermitType(GeneralType): @@ -58,6 +60,8 @@ class PermitType(GeneralType):          verbose_name = _(u"Permit type")          verbose_name_plural = _(u"Permit types")          ordering = ('label',) +post_save.connect(post_save_cache, sender=PermitType) +post_delete.connect(post_save_cache, sender=PermitType)  if settings.COUNTRY == 'fr':      class SaisineType(GeneralType, ValueGetter): @@ -67,6 +71,8 @@ if settings.COUNTRY == 'fr':              verbose_name = u"Type Saisine"              verbose_name_plural = u"Types Saisine"              ordering = ('label',) +    post_save.connect(post_save_cache, sender=SaisineType) +    post_delete.connect(post_save_cache, sender=SaisineType)  class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, | 
