'Indexes an item into our `name_to_item` dictionary.
If an object holding the same item\'s name/key already exists in the index
then the conflict is managed by the `manage_conflict` method.
:param item: The item to index
:param name: The optional name to use to index the item'

def index_item(self, item):

    name_property = getattr(self.__class__, 'name_property', None)
    name = getattr(item, name_property, '')
    if (not name):
        objcls = self.inner_class.my_type
        mesg = ('a    %s    item    has    been    defined    without    %s%s' % (objcls, name_property, self.get_source(item)))
        item.configuration_errors.append(mesg)
    elif (name in self.name_to_item):
        if (item.id != self.name_to_item[name].id):
            item = self.manage_conflict(item, name)
    self.name_to_item[name] = item
    return item
