On Feb 16, 2006, at 10:51 AM, Andrus wrote:

I think typical application should use the following approach:

1. Using user name and password entered in login from, create connection object as TestSecurityManager class property in validateLogin method. Set
custom connection-level properties if required using execute()

#TestSecurityManager validateLogin method:
self.connection = dConnection(ci)
cursor = self.connection.getConnection().cursor()
#As I understand next line is not safe. Where I should make this setting
common to all
# forms ?
cursor.execute("set search_path to public,company"+companynumber)

I'm going to look into this, but right now I'm buried in UI stuff in preparation for next week's PyCon presentation. I've just committed some changes that provide a bizobj method of 'execute()', that passes the statement it receives to the cursor for execution. From your forms, you should never be interacting with the database; instead, you should be talking to the bizobj.

2. In MyFormBase afterInit method assign the same connection to form:

self.connection = dabo.dAppRef.SecurityManager.connection

Is this good approach ?

It sounds fine, but since I'm not able to test it myself, please run as many tests on this as you can, and let me know of any problems or concerns.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users

Reply via email to