def save(self, commit=True): instance = super(PresentionForm, self).save(commit=False) if not instance.slug: instance.slug = unique_slug_generator_identif( instance, instance.titre) if commit: instance.save() return instance
def save(self, commit=True): instance = super(PartenaireForm, self).save(commit=False) print("Voici instance", instance) if not instance.slug: instance.slug = unique_slug_generator_identif( instance, instance.nom) if commit: instance.save() return instance
def presentation_pre_save_receiver(sender, instance, *args, **kwargs): if not instance.slug: instance.slug = unique_slug_generator_identif(instance, instance.titre)
def cycle_pre_save_receiver(sender, instance, *args, **kwargs): if not instance.slug: instance.slug = unique_slug_generator_identif(instance, instance.nom)