Commit 710d8d8ff7c94b572489f50957b214e59f9b2599

Authored by janek37
1 parent 17be20f2

poprawka do importu słowników

dictionary/management/commands/import_data.py
... ... @@ -319,13 +319,15 @@ class ImportData(object):
319 319 )
320 320  
321 321 def new_vocabularies(self):
  322 + self.cache_vocabs()
322 323 result = self.sqlite_cursor.execute("""
323 324 SELECT slownik FROM leksemy
324 325 UNION
325 326 SELECT slownik_uz FROM slowniki_uzywajace
326 327 """)
327 328 for row in result:
328   - yield Vocabulary(id=row[0])
  329 + if row[0] not in self.vocabs:
  330 + yield Vocabulary(id=row[0])
329 331  
330 332 def cache_vocabs(self):
331 333 if 'vocabs' not in self.__dict__:
... ...