From 2b27d56e54e490f27f15498bee18f30c655fc39c Mon Sep 17 00:00:00 2001 From: Arvind Tiwari Date: Thu, 29 Mar 2018 00:43:38 +0530 Subject: [PATCH] cmsintegrate management command --- datacenterlight/management/commands/cmsintegrate.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 datacenterlight/management/commands/cmsintegrate.py diff --git a/datacenterlight/management/commands/cmsintegrate.py b/datacenterlight/management/commands/cmsintegrate.py new file mode 100644 index 00000000..5b4f72d2 --- /dev/null +++ b/datacenterlight/management/commands/cmsintegrate.py @@ -0,0 +1,13 @@ +from django.core.management.base import BaseCommand +from datacenterlight.cms_models import CMSIntegration + + +class Command(BaseCommand): + help = '''Creates cms integration objects for datacenterlight''' + + def handle(self, *args, **options): + obj, created = CMSIntegration.objects.get_or_create(name='default') + if created: + print('created the default CMSIntegration object') + else: + print('default CMSIntegration object already exists')