I am having trouble with part of my code and it stems from the attributes not updating when I believe they should be updating.
if str(f[t1st])==str(f2[start_index]): layer.startEditing() layer.changeAttributeValue(f2.id(),t1st, str(f2[end_index])) layer.changeAttributeValue(f2.id(),t2nd, str(f2[start_index])) layer.commitChanges() print f2[end_index] print f2[t2nd]
This is in the middle of a for loop. The first print statement returns the correct value but the second print value is always NULL. If create a for loop right after, the attributes show as updated and not NULL. Shouldn't the attributes update after I the layer.commitChanges() line? When will the attributes update?