def save(self, *args, **kwargs): self.the_geom = force2d(self.the_geom) self.simplified_geom = simplify_geom(self.the_geom,force_buffer=self.buffer_aoi) super(Job, self).save(*args, **kwargs)
def resimplify(apps, schema_editor): Job = apps.get_model('jobs', 'Job') for job in Job.objects.all(): job.simplified_geom = simplify_geom(job.the_geom,force_buffer=job.buffer_aoi) job.save()