Commit 7d85cc0ac89c6b40c4251b37614bc3fa0a20aa88

Authored by janek37
1 parent f24d57a9

poprawka do typu nazwy

dictionary/management/commands/import_data.py
... ... @@ -414,8 +414,10 @@ class ImportData(object):
414 414 for row in result:
415 415 slownik = row['slownik']
416 416 status = 'conf' if slownik != 'zmiotki' else 'cand'
417   - cv = cv_table.get(COMMONNESS_TRANSLATION.get(
418   - row['pospolitosc'], row['pospolitosc']))
  417 + comms = row['typnazwy'].split(' a. ') or [row['pospolitosc']]
  418 + cvs = [
  419 + cv_table.get(COMMONNESS_TRANSLATION.get(comm, comm))
  420 + for comm in comms if comm]
419 421 lexemes.append(Lexeme(
420 422 id=row['nr'],
421 423 entry=row['haslo'],
... ... @@ -437,7 +439,7 @@ class ImportData(object):
437 439 ))
438 440 lexeme_associations.append(LexemeAssociation(
439 441 lexeme_id=row['nr'], vocabulary_id=slownik))
440   - if cv:
  442 + for cv in cvs:
441 443 lexeme_cvs.append(
442 444 LexemeCV(lexeme_id=row['nr'], classification_value=cv))
443 445 for kwal in (row['kwalstyl'], row['kwalzakr']):
... ...