Ejemplo n.º 1
0
def add_key_to_CartObj(sender, instance, *args, **kwargs):
    if not instance.key:
        instance.key = unique_key_generator(instance, size=12)
Ejemplo n.º 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))
Ejemplo n.º 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)