def get_item_type_id_from_identifier(self, identifier, item_types=None):
        """
        Get an ID of item type for the given identifier. Identifier is a string of
        the following form:

        <model_prefix>/<model_identifier>

        where <model_prefix> is any suffix of database table of the given model
        which uniquely specifies the table, and <model_identifier> is
        identifier of the object.

        Args:
            identifier (str): item identifier
            item_types (dict): ID -> item type JSON

        Returns:
            int: ID of the corresponding item type
        """
        if item_types is None:
            item_types = ItemType.objects.get_all_types()
        identifier_type, _ = identifier.split('/')
        item_types = [it for it in item_types.values() if it['table'].endswith(identifier_type)]
        if len(item_types) > 1:
            raise Exception('There is more than one item type for name "{}".'.format(identifier_type))
        if len(item_types) == 0:
            raise Exception('There is no item type for name "{}".'.format(identifier_type))
        return item_types[0]['id']