Skip to content

Instantly share code, notes, and snippets.

@mjumbewu
Created September 25, 2012 22:18
Show Gist options
  • Select an option

  • Save mjumbewu/3784808 to your computer and use it in GitHub Desktop.

Select an option

Save mjumbewu/3784808 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
from django.core.management import setup_environ
import settings
setup_environ(settings)
from django.conf import settings
from django.contrib.gis.gdal import CoordTransform, DataSource, OGRGeometry, OGRGeomType
from django.core.management.base import BaseCommand
from django.db import connections, DEFAULT_DB_ALIAS, transaction
from boundaryservice.models import BoundarySet, Boundary
A = Boundary.objects.get(external_id='270532150')
B = Boundary.objects.get(external_id='270532160')
A.shape, B.shape = B.shape, A.shape
A.simple_shape, B.simple_shape = B.simple_shape, A.simple_shape
A.centroid, B.centroid = B.centroid, A.centroid
A.save()
B.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment