def create_default_per_instance_preferences(sender, created, instance, **kwargs): """Create default preferences for PerInstancePreferenceModel""" if created: try: registry = preference_models.get_by_instance(instance) registry.create_default_preferences(instance) except AttributeError: pass
def registry(self): return preference_models.get_by_instance(self.instance)