'Returns the data object whose ID matches ``loopup`` parameter.
The data object is looked up from the table\'s dataset and
the data which matches the ``lookup`` parameter specified.
An error will be raised if the match is not a single data object.
We will convert the object id and ``lookup`` to unicode before
comparison.
Uses :meth:`~horizon.tables.DataTable.get_object_id` internally.'

def get_object_by_id(self, lookup):

    if (not isinstance(lookup, six.text_type)):
        lookup = str(lookup)
        if six.PY2:
            lookup = lookup.decode('utf-8')
    matches = []
    for datum in self.data:
        obj_id = self.get_object_id(datum)
        if (not isinstance(obj_id, six.text_type)):
            obj_id = str(obj_id)
            if six.PY2:
                obj_id = obj_id.decode('utf-8')
        if (obj_id == lookup):
            matches.append(datum)
    if (len(matches) > 1):
        raise ValueError(('Multiple    matches    were    returned    for    that    id:    %s.' % matches))
    if (not matches):
        raise exceptions.Http302(self.get_absolute_url(), (_('No    match    returned    for    the    id    "%s".') % lookup))
    return matches[0]
