'Insert template reference into index at position.
A position value of None means to simply append.'

def insert(self, ft_id, position=None, flair_type=USER_FLAIR):

    ft_ids = list(self.iter_template_ids(flair_type))
    if (position is None):
        position = len(ft_ids)
    if ((position < 0) or (position > len(ft_ids))):
        raise IndexError(position)
    ft_ids.insert(position, ft_id)
    for k in self._index_keys(flair_type):
        del self[k]
    for (i, ft_id) in enumerate(ft_ids):
        setattr(self, self._make_index_key(i, flair_type), ft_id)
    self._commit()
