В моем плагине для Qgis мне нужно использовать две базы данных, SQLite и MySQL, для взаимодействия с ними я использую Elixir 0.7.1 и SqlAlchemy 0.7.4.Когда я использовал только SQLite, все было хорошо, недавно я добавил модуль для MySQL, поскольку я тестировал их по отдельности, они хорошо работают, но когда я собрал все вместе, я получил это из qgis:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 164, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "/home/giuseppe/.qgis/python/plugins/mmasgis/__init__.py", line 37, in classFactory
return mmasgis(iface)
File "/home/giuseppe/.qgis/python/plugins/mmasgis/mmasgis.py", line 84, in __init__
self.selectionList=Lista()
File "/home/giuseppe/.qgis/python/plugins/mmasgis/lista.py", line 7, in __init__
self.util=utility([],0)
File "/home/giuseppe/.qgis/python/plugins/mmasgis/utility.py", line 266, in __init__
initDB()
File "/home/giuseppe/.qgis/python/plugins/mmasgis/mysqlEntities.py", line 7, in initDB
setup_all()
File "/usr/lib/pymodules/python2.7/elixir/__init__.py", line 94, in setup_all
setup_entities(entities)
File "/usr/lib/pymodules/python2.7/elixir/entity.py", line 951, in setup_entities
method()
File "/usr/lib/pymodules/python2.7/elixir/entity.py", line 240, in setup_relkeys
self.call_builders('create_non_pk_cols')
File "/usr/lib/pymodules/python2.7/elixir/entity.py", line 481, in call_builders
getattr(builder, what)()
File "/usr/lib/pymodules/python2.7/elixir/fields.py", line 155, in create_non_pk_cols
self.create_col()
File "/usr/lib/pymodules/python2.7/elixir/fields.py", line 160, in create_col
self.add_table_column(self.column)
File "/usr/lib/pymodules/python2.7/elixir/properties.py", line 84, in add_table_column
self.entity._descriptor.add_column(column)
File "/usr/lib/pymodules/python2.7/elixir/entity.py", line 493, in add_column
(col.key, self.entity.__name__))
Exception: Column 'nome' already exist in 'Regione' !
Versione Python:
2.7.2+ (default, Oct 4 2011, 20:29:37)
[GCC 4.6.1]
Versione di QGIS:
1.9.90-Alpha Alpha, exported
Percorso Python: ['/usr/share/qgis/python', '/home/giuseppe/.qgis/python', '/home /giuseppe/.qgis/python/plugins', '/usr/share/qgis/python/plugins', '/usr/local/lib/python2.7/dist-packages/pyshp-1.1.4-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/SQLAlchemy-0.7.4-py2.7-linux-i686.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/Numeric', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/pymodules/python2.7/ubuntuone-dev-tools', '/usr/lib/pymodules/python2.7/libubuntuone', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/ubuntuone-client', '/usr/lib/python2.7/dist-packages/ubuntuone-control-panel', '/usr/lib/python2.7/dist-packages/ubuntuone-couch', '/usr/lib/python2.7/dist-packages/ubuntuone-file-storage-api', '/usr/lib/python2.7/dist-packages/ubuntuone-installer', '/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', '/usr/share/qgis/python/plugins/fTools/tools', '/home/giuseppe/Documenti/doc/progetti/mmasgis/gianluca/ProgettoGIS', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/', '/home/giuseppe/eclipse/plugins/org.python.pydev.debug_2.3.0.2011121518/pysrc/']
это мой модуль для SQLite: http://pastebin.com/ya4q9En1 это модуль для MySQL: http://pastebin.com/3NypygV4
Можете ли вы помочь мне понять, где моя ошибка?