Yuego / django-fias

Other
113 stars 70 forks source link

django.core.exceptions.FieldError #94

Closed Khovanskiy5 closed 5 years ago

Khovanskiy5 commented 5 years ago

(fiasenv) khovanskiy@ubuntu-server:~/fias/fiasenv/django-fias/test_project$ python manage.py fias --src ../../../fias_xml.rar --i-know-what-i-do --truncate Version info updated at 2019-04-26 13:58:39.800450+00:00. Estimated time: 0:00:04.273767 Loading data v.538 started at 2019-04-26 13:58:39.815834+00:00 Traceback (most recent call last): File "/home/khovanskiy/fias/fiasenv/django-fias/test_project/fias/importer/commands.py", line 68, in load_complete_data st = Status.objects.get(table=tbl) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/db/models/manager.py", line 127, in manager_method return getattr(self.get_queryset(), name)(*args, **kwargs) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/db/models/query.py", line 334, in get self.model._meta.object_name fias.models.version.DoesNotExist: Status matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/core/management/init.py", line 338, in execute_from_command_line utility.execute() File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/core/management/init.py", line 330, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/core/management/base.py", line 390, in run_from_argv self.execute(*args, *cmd_options) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/core/management/base.py", line 441, in execute output = self.handle(args, **options) File "/home/khovanskiy/fias/fiasenv/django-fias/test_project/fias/management/commands/fias.py", line 178, in handle tempdir=tempdir, File "/home/khovanskiy/fias/fiasenv/django-fias/test_project/fias/importer/commands.py", line 83, in load_complete_data remove_indexes_from_model(model=first_table.model) File "/home/khovanskiy/fias/fiasenv/django-fias/test_project/fias/importer/indexes.py", line 65, in remove_indexes_from_model change_indexes_for_model(model=model, field_from=field, field_to=simple_field) File "/home/khovanskiy/fias/fiasenv/django-fias/test_project/fias/importer/indexes.py", line 58, in change_indexes_for_model ed.alter_field(model, field_from, field_to) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 484, in alter_field old_db_params, new_db_params, strict) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/db/backends/sqlite3/schema.py", line 200, in _alter_field self._remake_table(model, alter_fields=[(old_field, new_field)]) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/db/backends/sqlite3/schema.py", line 133, in _remake_table temp_model = type(model._meta.object_name, model.bases, body) File "/home/khovanskiy/fias/fiasenv/lib/python3.6/site-packages/django/db/models/base.py", line 254, in new 'base class %r' % (field.name, name, base.name) django.core.exceptions.FieldError: Local field 'name' in class 'FlatType' clashes with field of similar name from base class 'AbstractType'

(fiasenv) khovanskiy@ubuntu-server:~/fias/fiasenv/django-fias/test_project$ pip list Package Version


appdirs 1.4.3 attrs 19.1.0 cached-property 1.5.1 certifi 2019.3.9 chardet 3.0.4 dbfread 2.0.7 defusedxml 0.6.0 Django 1.8 django-appconf 1.0.3 django-extensions 2.1.6 django-fias 1.2.5 Django-Select2 5.3.0 idna 2.8 isodate 0.6.0 lxml 4.3.3 pip 19.1 progress 1.5 pytz 2019.1 rarfile 3.0 requests 2.21.0 requests-toolbelt 0.9.1 setuptools 41.0.1 six 1.12.0 unrar 0.3 urllib3 1.24.2 wheel 0.33.1

(fiasenv) khovanskiy@ubuntu-server:~/fias/fiasenv/django-fias/test_project$ uname -a Linux ubuntu-server 4.15.0-43-generic #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux 18.04 LTS

(fiasenv) khovanskiy@ubuntu-server:~/fias/fiasenv/django-fias/test_project$ python --version Python 3.6.7

разворачивал test_project

LennyLip commented 5 years ago

Такая же фигня была, добавил strstat по-моему. Или еще что-то, не помню, сравните таблицу fias.fias_status;

strstat

Khovanskiy5 commented 5 years ago

@LennyLip Спасибо, поковыряю отпишу...

Khovanskiy5 commented 5 years ago

@LennyLip огромное спасибо. Помогло

Version info updated at 2019-05-21 12:17:32.814689+00:00. Estimated time: 0:00:01.297649 Loading data v.542 started at 2019-05-21 12:17:32.838776+00:00 T: flattype. L: 11 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_FLATTYPE_20190519_45a0dcd6-899f-4c8b-a5c4-74a5e2cb023c.XML T: roomtype. L: 3 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_ROOMTYPE_20190519_593257ba-891e-4b82-b0b8-36db101e2c24.XML T: actstat. L: 2 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_ACTSTAT_20190519_01c2e5f9-91c3-4394-b11a-4063cb5bf15a.XML T: centerst. L: 5 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_CENTERST_20190519_0cc6ab65-8aae-4a50-aad2-c024588cc68c.XML T: curentst. L: 100 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_CURENTST_20190519_cc2026ac-cc6e-4dfc-863b-7cd0fb5350ac.XML T: eststat. L: 7 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_ESTSTAT_20190519_3d9e7142-8e54-43ac-a15d-e71fbe2e2578.XML T: hststat. L: 43 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_HSTSTAT_20190519_0d8ed1fd-88d0-4328-b91b-b3da9da565f8.XML T: intvstat. L: 4 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_INTVSTAT_20190519_94eb97b1-4e4d-4c60-a0e6-5cfda57d22dd.XML T: ndoctype. L: 26 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_NDOCTYPE_20190519_329a097b-58c6-4b6c-bea6-d7b3e498f5aa.XML T: operstat. L: 17 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_OPERSTAT_20190519_b6eab271-2ff2-45aa-8704-2466d966ad0a.XML T: strstat. L: 4 | U: 0 | S: 1[E:0] | R: 0[0] FN: AS_STRSTAT_20190519_00a254c7-be36-427e-8f44-188a1b34ae77.XML T: socrbase. L: 407 | U: 0 | S: 2[E:0] | R: 0[0] FN: AS_SOCRBASE_20190519_220c6554-ce9b-4c47-8f15-b55ed468fdbe.XML T: addrobj. L: 1351756 | U: 0 | S: 2499891[E:0] | R: 0[0] FN: AS_ADDROBJ_20190519_e60fd9f7-7485-411e-92af-ef0a9c5a7fcc.XML T: addrobj. L: 0 | U: 0 | S: 0[E:0] | R: 0[0] FN: AS_DEL_ADDROBJ_20190519_4ce0dde9-5bb2-4429-91d7-9f2797ee6be8.XML Data v.542 from 2019-05-16 loaded at 2019-05-21 12:35:40.913381+00:00 Estimated time: 0:18:09.396341. Download: 0. Unpack: 0. Import: 0:18:08.079616

что-то мне кажется много скипов в addrobj