'Add (name, value) to an update query for an ancestor model.
Update are coalesced so that only one update query per ancestor is run.'

def add_related_update(self, model, field, value):

    self.related_updates.setdefault(model, []).append((field, None, value))
