Allows set_key command to set keys that already exists

pull/1/head
Raymond Yee 2012-05-10 08:34:45 -07:00
parent 9aa586181e
commit 33642190cb
1 changed files with 2 additions and 1 deletions

View File

@ -6,6 +6,7 @@ class Command(BaseCommand):
args = "<name> <value>"
def handle(self, name, value, **options):
k = Key.objects.create(name=name, value=value)
(k, created) = Key.objects.get_or_create(name=name)
k.value = value
k.save()