def create_shapes(self, data, **kwargs):
        shapes = {}
        for row in data:
            try:
                id = int(row['shape_id'])
            except ValueError:
                print 'WARNING: Could not process shape id of %s' % row
                continue

            if id not in shapes:
                shapes[id] = []

            try:
                lat = float(row['shape_pt_lat'])
                lng = float(row['shape_pt_lon'])
            except __HOLE__:
                print 'WARNING: Could not process shape coordinates of %s' % row
                continue

            shapes[id].append((lat, lng))

        for id, points in shapes.iteritems():
            try:
                Shape(id=id, points=points).save()
            except:
                print 'Shape exists'
                continue
dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/management/commands/import_marta_data.py/ImportMartaData.create_shapes