'Returns true if we updated the field.
The optional ``ignore`` parameter, if present, is a version to not
consider as part of the update, since it may be in the process of being
deleted.
Pass ``_signal=False`` if you want to no signals fired at all.'

@use_master
def update_version(self, ignore=None, _signal=True):

    current = self.get_public_version()
    try:
        latest_qs = self.versions.all()
        if (ignore is not None):
            latest_qs = latest_qs.exclude(pk=ignore.pk)
        latest = latest_qs.latest()
    except Version.DoesNotExist:
        latest = None
    latest_id = (latest and latest.id)
    diff = [self._current_version, current]
    try:
        if self._latest_version:
            unicode(self._latest_version)
        diff += [self._latest_version, latest]
    except Version.DoesNotExist:
        diff += [self._latest_version_id, latest_id]
    updated = {}
    send_signal = False
    if (self._current_version != current):
        updated.update({'_current_version': current})
        send_signal = True
    if (self._latest_version_id != latest_id):
        updated.update({'_latest_version': latest})
    if (ignore is not None):
        updated = dict([(k, v) for (k, v) in updated.iteritems() if (v != ignore)])
    if updated:
        updated['_signal'] = _signal
        try:
            self.update(**updated)
            if (send_signal and _signal):
                signals.version_changed.send(sender=self)
            log.info((u'Version    changed    from    current:    %s    to    %s,    latest:    %s    to    %s    for    addon    %s' % tuple((diff + [self]))))
        except Exception as e:
            log.error((u'Could    not    save    version    changes    current:    %s    to    %s,    latest:    %s    to    %s    for    addon    %s    (%s)' % tuple((diff + [self, e]))))
    return bool(updated)
