This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aldryn_search.search_indexes import TitleIndex | |
from cms.models import CMSPlugin | |
from djangocms_misc.global_untranslated_placeholder.utils import get_untranslated_default_language | |
class UntranslatedTitleIndex(TitleIndex): | |
def get_plugin_queryset(self, language): | |
queryset = CMSPlugin.objects.filter( | |
language=get_untranslated_default_language() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models.signals import post_init | |
def track_data(*fields): | |
""" | |
Tracks property changes on a model instance. | |
The changed list of properties is refreshed on model initialization | |
and save. | |
>>> @track_data('name') |