From 3e57386cb22aafd0dc8acede47fc0ed34017f352 Mon Sep 17 00:00:00 2001 From: Charles Holbrow Date: Mon, 25 Mar 2013 19:51:52 -0400 Subject: [PATCH] adding management command to regenerate note slugs --- .../management/commands/regen_note_slugs.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 karmaworld/apps/notes/management/commands/regen_note_slugs.py diff --git a/karmaworld/apps/notes/management/commands/regen_note_slugs.py b/karmaworld/apps/notes/management/commands/regen_note_slugs.py new file mode 100644 index 0000000..56b801a --- /dev/null +++ b/karmaworld/apps/notes/management/commands/regen_note_slugs.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding:utf8 -*- +# Copyright (C) 2012 FinalsClub Foundation + +from django.core.management.base import BaseCommand +from apps.notes.models import Note + +class Command(BaseCommand): + args = 'none' + help = "regenerate all note slugs" + + def handle(self, *args, **kwargs): + notes = Note.objects.fall() + for n in notes: + n.slug = None + n.save() + -- 2.25.1