Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
def presentation_pre_save_receiver(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator_identif(instance, instance.titre)
Ejemplo n.º 4
0
def cycle_pre_save_receiver(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator_identif(instance, instance.nom)