Skip to content
  • eric's avatar
    Changeable pad names. Includes South migration. · 1203d9f2
    eric authored
        So this is kind of convoluted. With an input like
    
        Relearn::Can it scale to the universe
    
        we get a pad, with the unchangeable id:
    
        relearn::can-it-scale-to-the-universe
    
        This id becomes the initial value for the (changeable) url slug, as display_slug.
        Based on this id we also set the (changeable) display name, as display_name,
        through a slight transformation (- becomes space, :: →) as in:
    
        relearn → can it scale to the universe
    
    After migration, update existing install as such:
    
    from etherpadlite.models import Pad
    from relearn.templatetags.wikify import dewikify
    
    for pad in Pad.objects.all():
        pad.display_slug = pad.name
        pad.display_name = dewikify(pad.name)
        pad.save()
    1203d9f2