zoo_meta: ajoute un hook sur les classes AppConfig pour personnaliser la reconstruction des index (#19092)

This commit is contained in:
Benjamin Dauvergne 2017-12-27 16:55:51 +01:00 committed by Thomas NOEL
parent efaafa575d
commit 6137d25ab9
1 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@
from hashlib import md5
from django.apps import apps
from django.db import models, connection
from django.utils.translation import ugettext_lazy as _
from django.contrib.postgres.fields import JSONField
@ -133,6 +134,11 @@ class CommonSchema(models.Model):
if m is not None:
m(cursor, table, path)
# delegate index building to custom applications
for app in apps.get_app_configs():
if hasattr(app, 'zoo_rebuild_indexes'):
app.zoo_rebuild_indexes(self)
objects = GetBySlugManager()
def make_caption(self, value):