The following is currently unsuccessful at fulfilling a table field join to a point shapefile in Qgis.
All instances of the join object will print the proper values, and no error is flagged when processing - but the target layer does not exhibit any effect.
Something missing?
Heads = QgsVectorLayer(headCSV, 'Heads', 'ogr')
QgsMapLayerRegistry.instance().addMapLayer(Heads)
self.iface.legendInterface().setLayerVisible(Heads,False)
grid = ftools_utils.getMapLayerByName(unicode('Grid'))
joinObject = QgsVectorJoinInfo()
joinObject.targetFieldName = str('ID')
joinObject.joinLayerID = Heads.id()
joinObject.joinFieldName = str('cellID')
grid.addJoin(joinObject)
grid.reload()
UPDATE:
The following returns 'None'. I expect this is actually supposed to return the field names to be joined? (e.g. - a clue to the mistake)
print joinObject.joinFieldNamesSubset()
FURTHER UPDATE:
Added the following, and now the previous update command returns the accurate fields to be joined - yet the destination layer does not show 'joined' fields...
joinObject.setJoinFieldNamesSubset(['someFieldName'])