Package madrona :: Package studyregion :: Package management :: Package commands :: Module summarize_study_region_changes
[hide private]

Source Code for Module madrona.studyregion.management.commands.summarize_study_region_changes

 1  from django.core.management.base import BaseCommand, AppCommand 
 2  from optparse import make_option 
 3  from django.contrib.gis.utils import LayerMapping 
 4  from django.contrib.gis.gdal import DataSource 
 5  from madrona.studyregion.models import StudyRegion 
 6  from progressbar import Bar, Percentage, RotatingMarker, ProgressBar, ETA 
 7  import time 
 8   
 9   
10 -class Command(BaseCommand):
11 help = "Switches from one study region to another, reprocessing MPAs and expiring report caches." 12 args = '[pk]' 13
14 - def handle(self, pk, **options):
15 # new_study_region = StudyRegion.objects.get(pk=pk) 16 # old_study_region = StudyRegion.objects.current() 17 # diff = old_study_region.geometry.sym_difference(new_study_region.geometry) 18 # find models that need to be reclipped somehow 19 # for model in models: 20 # for obj in model.objects.filter(geometry_intersects=diff) 21 # print "%s,%s,%s" % (obj.__class__.__name__, obj.name, obj.user.username, ) 22 print """ 23 ********************************************** 24 This is just example output until implemented. 25 ********************************************** 26 """ 27 print "MLPAMpas, MPA Name, cburt" 28 print "MLPAMpas, Test MPA, another_user"
29