'Return a serializable representation of the requested block'

def to_representation(self, block_key):

    data = {'id': unicode(block_key), 'block_id': unicode(block_key.block_id), 'lms_web_url': reverse('jump_to', kwargs={'course_id': unicode(block_key.course_key), 'location': unicode(block_key)}, request=self.context['request']), 'student_view_url': reverse('courseware.views.views.render_xblock', kwargs={'usage_key_string': unicode(block_key)}, request=self.context['request'])}
    if (settings.FEATURES.get('ENABLE_LTI_PROVIDER') and ('lti_url' in self.context['requested_fields'])):
        data['lti_url'] = reverse('lti_provider_launch', kwargs={'course_id': unicode(block_key.course_key), 'usage_id': unicode(block_key)}, request=self.context['request'])
    for supported_field in SUPPORTED_FIELDS:
        if (supported_field.requested_field_name in self.context['requested_fields']):
            field_value = self._get_field(block_key, supported_field.transformer, supported_field.block_field_name, supported_field.default_value)
            if (field_value is not None):
                data[supported_field.serializer_field_name] = field_value
    if ('children' in self.context['requested_fields']):
        children = self.context['block_structure'].get_children(block_key)
        if children:
            data['children'] = [unicode(child) for child in children]
    return data
