def import_tsv(s, wdict):

    user = wdict.user
    i = 1
    word_pairs = []
    for line in s.splitlines():
        line = line.strip()
        if (line == ''):
            continue

        fields = line.split('\t')
        if len(fields) < 2:
            msg = (_('Not enough fields in line %(linenumber)s: %(line)s') %
                   {'linenumber': i, 'line': line})
            raise EWException(msg)
        elif 2 <= len(fields) <= 3:
            wp = WordPair()
            wp.word_in_lang1 = fields[0]
            wp.word_in_lang2 = fields[1]
            if len(fields) == 3:
                wp.explanation = fields[2]
            wp.date1 = get_today(user)
            wp.date2 = get_today(user)
            wp.date_added = get_today(user)
            word_pairs.append(wp)
        else:
            msg = (_('Too many fields in line %(linenumber)s: %(line)s') %
                   {'linenumber': i, 'line': line})
            raise EWException(msg)

        i += 1

    create_add_word_pairs(wdict, word_pairs)
    return word_pairs
The model factory for this object.
dataset/ETHPy150Open hcs42/ExponWords/models.py/import_tsv--crossover with--dataset/ETHPy150Open mozilla/moztrap/tests/model/library/api/test_caseversion_resource.py/CaseVersionSelectionResourceTest.factory