def set_end(sender, instance, **kwargs):
    if instance.start:
        if instance.duration:
            seconds = reduce(lambda x, i: x*60 + i,
                list(map(float, instance.duration.split(':'))))
            instance.end = instance.start + \
               datetime.timedelta(seconds=seconds)
        elif instance.end:
            # calc duration based on End
            d = instance.end - instance.start
            seconds = d.total_seconds()
            hms = seconds//3600, (seconds%3600)//60, seconds%60
            instance.duration = "%02d:%02d:%02d" % hms
        else:
            instance.end = None
    else:
        instance.end = None