On 07/12/2012 04:51 AM, Sibylle Koczian wrote:
> Hello,
>
> I want to change the database backend for an existing (test) application
> from SQLite to PostgreSQL. The table structures are identical, so I
> thought I just had to do three things:
>
> - create the application using "app = dabo.dApp("myCryptoKey")
> - put a .cnxml file in the db directory of the application which is
> right for the PostgreSQL database (and which works in another application)
> - edit the line "
> conn = self.Application.getConnectionByName("myConnectionName")
> in the createBizobjs() method of the main window class.
>
> But after doing this and calling the main method of the application,
> nothing happens. No error message in the terminal and no window. I put
> print statements into main() and it seems that app.start() is the place
> where it hangs. Print statements in afterInit() and createBizobjs() of
> the main window class aren't executed.
>
> Then I started the CxnEditor and opened the .cnxml file. I entered the
> CryptoKey, everything in the form looked normal, only the password field
> empty and the "Home directory" is the directory I started the CxnEditor
> from. Clicking the "Test" button (still with the empty password field)
> gives "Connection was successful". Clicking the "Save" button gives this
> exception:
>
> sib@gespenst-xubuntu:~/src/dabo-trunk/ide$ ./CxnEditor.py
> /home/sib/src/dabo-trunk/dabo/lib/SimpleCrypt.py:52: UserWarning:
> WARNING: SimpleCrypt is not secure. Please see
> http://wiki.dabodev.com/SimpleCrypt for more information
>     warnings.warn("WARNING: SimpleCrypt is not secure. Please see
> http://wiki.dabodev.com/SimpleCrypt for more information")
> Traceback (most recent call last):
>     File "/home/sib/src/dabo-trunk/dabo/ui/uiwx/dControlMixin.py", line
> 27, in _onWxHit
>       self.raiseEvent(dEvents.Hit, evt, *args, **kwargs)
>     File "/home/sib/src/dabo-trunk/dabo/ui/uiwx/dPemMixin.py", line 1074,
> in raiseEvent
>       super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
> **kwargs)
>     File "/home/sib/src/dabo-trunk/dabo/lib/eventMixin.py", line 81, in
> raiseEvent
>       bindingFunction(event)
>     File "./CxnEditor.py", line 274, in onSave
>       self.saveFile()
>     File "./CxnEditor.py", line 430, in saveFile
>       self.writeChanges()
>     File "./CxnEditor.py", line 543, in writeChanges
>       vals = self.relPaths(self.connDict.values())
>     File "./CxnEditor.py", line 556, in relPaths
>       if self.isFileBasedBackend(val["dbtype"]):
> KeyError: 'dbtype'
>
> What is happening here? What sort of information should I provide?
>
> Thank you,
> Sibylle

"app = dabo.dApp("myCryptoKey")"  - Checking the dApp() I do not see where you 
can pass the "myCryptoKey".
You can of course set a property such as "Crypto" or 'CryptoKey'. But I've been 
wrong in the past.

I'm not sure what is happening with the CxnEditor.  That said, make sure the 
information entered matches the requirements for Postgres.  I have noticed that 
it easy to miss something when changing backends.  It appears the error message 
is saying you are missing the 'dbtype' which is the type of database you are 
using.

Also I try to have only one connection file in the project.  Dabo's default is 
to load all connection files.  I also do not use the same connection name 
(getConnectionByName(unique_name)).

I've never had an error from CxnEditor.  So I'm surprised.  If the above does 
not work - try removing the crypto you have setup and just use Dabo's simple 
crypto to encode the password.



Johnf


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to