Пример #1
0
def slug_generator(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator(instance)
Пример #2
0
def product_pre_save_receiver(sender, instance, *args, **kwargs):
    """
     this pre_save signal creates unique slug for created products
    """
    if not instance.slug:
        instance.slug = unique_slug_generator(instance)
Пример #3
0
def tag_pre_save_receiver(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator(instance)
Пример #4
0
def products_pre_save_receiver(sender, instance, *args, **kwargs):
    if not instance.product_slug:
        instance.product_slug = unique_slug_generator(sender, instance, *args,
                                                      **kwargs)