# Path: crudbuilder/signals.py



import operator
import six
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.contrib.auth.views import redirect_to_login
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.conf import settings
from django.contrib import messages
from crudbuilder.signals import crudbuilder_signals
    from functools import reduce
    - app_label : return app_label for CRUD model
    - actual_model_name : returns the actual model name (person -> person)
    - pluralized_model_name : return the pluralized_model_name
    (person -> people)
    """
    def get_context_data(self, **kwargs):
        context = super(CrudBuilderMixin, self).get_context_data(**kwargs)
        model = context['view'].model
        context['app_label'] = model._meta.app_label
        try:
            context['exclude'] = self.detailview_excludes
        except:
            context['exclude'] = None
        name = model._meta.verbose_name
        context['actual_model_name'] = name
        context['verbose_model_name'] = name
        name_plural = model._meta.verbose_name_plural
        context['pluralized_model_name'] = name_plural
        context['verbose_model_name_plural'] = name_plural
        context['custom_postfix_url'] = self.custom_postfix_url
        context['project_name'] = getattr(
            settings, 'PROJECT_NAME', 'CRUDBUILDER')
        return context

    @property
    def get_actual_signal(self):
        view = 'update' if self.object else 'create'
        if self.inlineformset:
            return crudbuilder_signals['inlineformset'][view]
        else:

# Path: crudbuilder/signals.py



# Path: crudbuilder/mixins.py
import operator
import six
from django.db.models import Q
from django.http import HttpResponseRedirect
from django.contrib.auth.views import redirect_to_login
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.conf import settings
from django.contrib import messages
from crudbuilder.signals import crudbuilder_signals
    from functools import reduce

    - app_label : return app_label for CRUD model
    - actual_model_name : returns the actual model name (person -> person)
    - pluralized_model_name : return the pluralized_model_name
    (person -> people)
    """
    def get_context_data(self, **kwargs):
        context = super(CrudBuilderMixin, self).get_context_data(**kwargs)
        model = context['view'].model
        context['app_label'] = model._meta.app_label
        try:
            context['exclude'] = self.detailview_excludes
        except:
            context['exclude'] = None
        name = model._meta.verbose_name
        context['actual_model_name'] = name
        context['verbose_model_name'] = name
        name_plural = model._meta.verbose_name_plural
        context['pluralized_model_name'] = name_plural
        context['verbose_model_name_plural'] = name_plural
        context['custom_postfix_url'] = self.custom_postfix_url
        context['project_name'] = getattr(
            settings, 'PROJECT_NAME', 'CRUDBUILDER')
        return context

    @property
    def get_actual_signal(self):
        view = 'update' if self.object else 'create'
        if self.inlineformset:
            return crudbuilder_signals['inlineformset'][view]
        else:

            return crudbuilder_signals['instance'][view]