IP Export & Import
hi it's me again after patch by @szymi- i can export ip addresses but when i try to import same exported data i get error
Line number: 1 - Column 'asset': not enough values to unpack (expected 2, got 1) OrderedDict([('asset', '1293'), ('asset_str', 'VirtualServer: test1 (IT-Infra - test1)'), ('network', '39'), ('network_str', 'MT-SR-none-VLAN (0.0.0.0/0 | VLAN: None)'), ('id', '14'), ('created', '2019-05-29 09:17:38'), ('modified', '2019-05-29 09:17:38'), ('last_seen', '2019-05-29 09:17:38'), ('ethernet', '8'), ('ethernet_str', 'None (xx:xx:xx:xx:xx)'), ('address', 'x.x.x.x'), ('hostname', ''), ('number', '170873905'), ('is_management', '0'), ('is_public', '0'), ('is_gateway', '0'), ('status', '1'), ('dhcp_expose', '0')]) Traceback (most recent call last): File "/opt/ralph/ralph-core/lib/python3.6/site-packages/import_export/fields.py", line 64, in clean value = self.widget.clean(value) File "/opt/ralph/ralph-core/lib/python3.6/site-packages/ralph/data_importer/widgets.py", line 176, in clean asset_type, asset_id = value.split("|") # dc/bo, pk ValueError: not enough values to unpack (expected 2, got 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/opt/ralph/ralph-core/lib/python3.6/site-packages/import_export/resources.py", line 374, in import_data self.import_obj(instance, row, real_dry_run) File "/opt/ralph/ralph-core/lib/python3.6/site-packages/import_export/resources.py", line 238, in import_obj self.import_field(field, obj, data) ValueError: Column 'asset': not enough values to unpack (expected 2, got 1)
Originally posted by @Talangor in https://github.com/allegro/ralph/issues/3449#issuecomment-497911290
nothing ?
some days ago, i test to export ip address ,but i faild that it comes up 500 error. today i find out that the IPAddress module in ralph web(https://ralph-demo.allegro.tech/) has changed. And even adding a ip address will cause 500 error.
@SuperChaw hey buddy I did something about this but it does not relate to the code itself I exported and created queries from MySQL database itself and I really really regret choosing Ralph and working on it maybe I'm wrong but i think it's designed so no one can migrate from Ralph you will see what I mean when you go and investigate SQL tables everything is referenced to other tables with id's
you will see what I mean when you go and investigate SQL tables everything is referenced to other tables with id's
late reply, but that's the way Django is working with databases, this relations are defined as model classes and database independent (more or less). So all the relationship are in the model and you can export that