def get_prepopulated_value(field, instance):
    """
    Returns preliminary value based on `populate_from`.
    """
    if hasattr(field.populate_from, '__call__'):
        return field.populate_from(instance)
    else:
        attr = getattr(instance, field.populate_from)
        return callable(attr) and attr() or attr
