Exemplo n.º 1
0
def update_slug(apps, schema_editor):
    GeoWalk = apps.get_model('paths', 'GeoWalk')

    for walk in GeoWalk.objects.all():
        if not walk.slug:
            walk.slug = unique_slug_generator(walk, walk.name, walk.slug)
            walk.save()
Exemplo n.º 2
0
def update_slug(apps, schema_editor):
    SinglePoint = apps.get_model('paths', 'SinglePoint')

    for point in SinglePoint.objects.all():
        if not point.slug:
            point.slug = unique_slug_generator(point, point.name, point.slug)
            point.save()
Exemplo n.º 3
0
def slug_save(sender, instance, *args, **kwargs):
    if not instance.slug:
        instance.slug = unique_slug_generator(instance, instance.name,
                                              instance.slug)