'Get a field value from the item to check against.'

def get_field_value_from_item(self, item, data, field):

    value = ''
    if (field == 'id'):
        value = item._id36
    elif (field == 'body'):
        body = item.body
        if self.ignore_blockquotes:
            body = '\n'.join((line for line in body.splitlines() if ((not line.startswith('>')) and (len(line) > 0))))
        value = body
    elif (field == 'domain'):
        if (not item.is_self):
            value = item.link_domain()
        else:
            value = ('self.' + data['subreddit'].name)
    elif (field.startswith('media_') and getattr(item, 'media_object', None)):
        try:
            if (field == 'media_author'):
                value = item.media_object['oembed']['author_name']
            elif (field == 'media_author_url'):
                value = item.media_object['oembed']['author_url']
            elif (field == 'media_description'):
                value = item.media_object['oembed']['description']
            elif (field == 'media_title'):
                value = item.media_object['oembed']['title']
        except KeyError:
            value = ''
    elif (field == 'account_age'):
        value = item._age
    elif (field == 'post_karma'):
        value = max(item.link_karma, g.link_karma_display_floor)
    elif (field == 'comment_karma'):
        value = max(item.comment_karma, g.comment_karma_display_floor)
    elif (field == 'combined_karma'):
        post = self.get_field_value_from_item(item, data, 'post_karma')
        comment = self.get_field_value_from_item(item, data, 'comment_karma')
        value = (post + comment)
    elif ((field == 'flair_text') and isinstance(item, Account)):
        value = item.flair_text(data['subreddit']._id, obey_disabled=True)
    elif ((field == 'flair_css_class') and isinstance(item, Account)):
        value = item.flair_css_class(data['subreddit']._id, obey_disabled=True)
    else:
        value = getattr(item, field, '')
    return value
