Beispiel #1
0
def pre_save_receiver(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator(instance)
    if is_year(instance.template.name):
        instance.period = 'y'
    else:
        instance.period = 'm'
    if not instance.period_verbose:
        instance.period_verbose = get_period_verbose(instance)
Beispiel #2
0
def pre_save_receiver(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator(instance)