src/cm/management/commands/set_workspacename.py
author raph
Wed, 03 Feb 2010 15:09:30 +0100
changeset 141 3acc965253e2
child 142 9b3438382e53
permissions -rw-r--r--
add set_workspacename and create_manager management commands

from django.core.management.base import LabelCommand, CommandError

class Command(LabelCommand):
    help = "Change workspace name"

    def handle(self, *labels, **options):
        if len(labels)!=1:
            raise CommandError('Enter workspace name')
        name = labels[0]
        from cm.models import Configuration
        Configuration.objects.set_workspace_name(name.decode('utf8'))