2012-05-10 00:17:18 +00:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from regluit.core.models import Key
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = "set a core.models.Key with name value"
|
|
|
|
args = "<name> <value>"
|
|
|
|
|
|
|
|
def handle(self, name, value, **options):
|
2012-05-10 15:34:45 +00:00
|
|
|
(k, created) = Key.objects.get_or_create(name=name)
|
|
|
|
k.value = value
|
2012-05-10 00:17:18 +00:00
|
|
|
k.save()
|
|
|
|
|