示例#1
0
def add_key_to_CartObj(sender, instance, *args, **kwargs):
    if not instance.key:
        instance.key = unique_key_generator(instance, size=12)
示例#2
0
def add_key_to_DiscountObj(sender, instance, *args, **kwargs):
    if not instance.key:
        instance.key = unique_key_generator(instance, size=randint(6, 10))
示例#3
0
def food_pre_save_receiver(sender, instance, *args, **kwargs):
    if not instance.key:
        instance.key = unique_key_generator(instance)
    if not instance.slug:
        instance.slug = unique_slug_generator(instance)