def insert(self, feature): couchdb_layer = '%s%s' % (self.prefix, feature.layer) couch = self._dbs.get(couchdb_layer, None) if not couch: couch = VectorCouchDB(self.url, couchdb_layer, couchdb_layer) self._dbs[couchdb_layer] = couch feature_dict = { 'geometry': feature.geometry, 'properties': feature.properties, 'type': 'Feature', } existing_feature = couch.get(feature.id) if existing_feature: feature_dict['_rev'] = existing_feature['_rev'] couch.put(feature.id, feature_dict) self.inserted_layers.add(feature.layer)