def get_prepopulated_value(field, instance):
    """Returns preliminary value based on `populate_from`.

    Args:
        field (:obj:`strawberry.fields.md5.MD5Field`): `MD5Field` instance.
        instance (:obj:`django.db.models.Model`): Django model instance.

    Returns:
        str: Prepopulated value.
    """
    if callable(field.populate_from):
        return field.populate_from(instance)
    else:
        attr = getattr(instance, field.populate_from)
        return callable(attr) and attr() or attr
