<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_field_value(self, instance, field_name):
 """ Given an instance, and the name of an attribute, returns the value of that attribute on the instance. Default behavior will map the ``percent`` attribute to ``id``. """

        # XXX: can we come up w/ a better API?
        # Ensure we map ``percent`` to the ``id`` column
        if field_name == 'percent':
            field_name = 'id'
        value = getattr(instance, field_name)
        if callable(value):
            value = value()
        return value