
from django.core.management.base import BaseCommand
from core.ws_utils import CachedWS as ws
from cvn.models import ReportArea, ReportDept
from django.utils.translation import ugettext as _


class Command(BaseCommand):
    help = _(u'Import department and area info from WebServices')

    def handle(self, *args, **options):
        ReportArea.reload()
        ReportDept.reload()

from django.core.management.base import BaseCommand
from core.ws_utils import CachedWS as ws
from cvn.models import ReportArea, ReportDept
from django.utils.translation import ugettext as _


class Command(BaseCommand):
    help = _(u'Import department and area info from WebServices')

    def handle(self, *args, **options):
        ReportArea.objects.all().delete()
        ReportDept.objects.all().delete()
        ReportArea.reload()
        ReportDept.reload()
Delete Report models before reloading them
Delete Report models before reloading them

  
  from django.core.management.base import BaseCommand
  from core.ws_utils import CachedWS as ws
  from cvn.models import ReportArea, ReportDept
  from django.utils.translation import ugettext as _
  
  
  class Command(BaseCommand):
      help = _(u'Import department and area info from WebServices')
  
      def handle(self, *args, **options):
+         ReportArea.objects.all().delete()
+         ReportDept.objects.all().delete()
          ReportArea.reload()
          ReportDept.reload()
Delete Report models before reloading them
## Code Before:

from django.core.management.base import BaseCommand
from core.ws_utils import CachedWS as ws
from cvn.models import ReportArea, ReportDept
from django.utils.translation import ugettext as _


class Command(BaseCommand):
    help = _(u'Import department and area info from WebServices')

    def handle(self, *args, **options):
        ReportArea.reload()
        ReportDept.reload()
## Instruction:
Delete Report models before reloading them
## Code After:

from django.core.management.base import BaseCommand
from core.ws_utils import CachedWS as ws
from cvn.models import ReportArea, ReportDept
from django.utils.translation import ugettext as _


class Command(BaseCommand):
    help = _(u'Import department and area info from WebServices')

    def handle(self, *args, **options):
        ReportArea.objects.all().delete()
        ReportDept.objects.all().delete()
        ReportArea.reload()
        ReportDept.reload()