コード例 #1
0
def slug_generator(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator(instance)
コード例 #2
0
ファイル: models.py プロジェクト: Rafeen/Ecommerce-Django
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)