'Returns a list of query objects: one for each update required to an
ancestor model. Each query will have the same filtering conditions as
the current query but will only update a single table.'

def get_related_updates(self):

    if (not self.related_updates):
        return []
    result = []
    for (model, values) in self.related_updates.iteritems():
        query = UpdateQuery(model)
        query.values = values
        if (self.related_ids is not None):
            query.add_filter(('pk__in', self.related_ids))
        result.append(query)
    return result
