Re: [dabo-users] error on windows side?
I did git remote update Is that incorrect? From my Android phone on T-Mobile. The first nationwide 4G network. Original message Subject: Re: [dabo-users] error on windows side? From: Paul McNett p...@ulmcnett.com To: jo...@jfcomputer.com,Dabo Users list dabo-users@leafe.com CC: On 1/10/13 8:04 AM, John Fabiani wrote: I thought you reversed the commits you made to the clone? I just ran the update and sure enough the it included your changes? Just to be clear we are talking about the same things, please: cd dabo git checkout working git pull Now take a look at, for instance, dabo/settings.py. Does the importDebugger line say True or False? If True, then you are seeing my reverted changes. Paul ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/buocxhnr7j0ulxlxy4x2wwju.1357854524...@email.android.com
Re: [dabo-users] Scroll events
On Sunday 07 March 2010 07:26:18 am Ed Leafe wrote: On Mar 5, 2010, at 3:52 PM, Larry wrote: What event do we use to capture a grid's scroll event? We need to fire a method upon scrolling. I've just added window scrolling events to the two classes that are based on wx.ScrolledWindow: dGrid and dScrollPanel. The events are: ScrollTop ScrollBottom ScrollLineUp ScrollLineDown ScrollPageUp ScrollPageDown ScrollThumbDrag ScrollThumbRelease However, I'm not sure about ScrollTop and ScrollBottom; the corresponding wx events never fire on OS X. Also, the position numbers returned by wx don't relate to any actual position, as far as I can tell. The events have two main values in EventData: orientation and position. Orientation will be either 'Horizontal' or 'Vertical', depending on which direction the scroll was. Position is a positive integer that seems to relate to how many 'lines' the scrolled window thinks it has. I'm not sure how that is calculated, but I've included it in case it's useful. -- Ed Leafe openSUSE 11.2, python 2.6.x wxpython 2.8.10 Traceback (most recent call last): File /home/johnf/dabo/dabo/ui/uiwx/dPanel.py, line 309, in __onWxScrollWin 10070: dEvents.ScrollThumbDrag, 10071: dEvents.ScrollThumbRelease}[typ] KeyError: 10144 Traceback (most recent call last): File /home/johnf/dabo/dabo/ui/uiwx/dPanel.py, line 309, in __onWxScrollWin 10070: dEvents.ScrollThumbDrag, 10071: dEvents.ScrollThumbRelease}[typ] KeyError: 10144 Traceback (most recent call last): File /home/johnf/dabo/dabo/ui/uiwx/dPanel.py, line 309, in __onWxScrollWin 10070: dEvents.ScrollThumbDrag, 10071: dEvents.ScrollThumbRelease}[typ] KeyError: 10145 ___ Post Messages to: Dabo-users@leafe.com 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/201003070901.33422.jo...@jfcomputer.com
Re: [dabo-users] Scroll events
On Sunday 07 March 2010 09:09:12 am Ed Leafe wrote: On Mar 7, 2010, at 12:01 PM, johnf wrote: Traceback (most recent call last): File /home/johnf/dabo/dabo/ui/uiwx/dPanel.py, line 309, in __onWxScrollWin 10070: dEvents.ScrollThumbDrag, 10071: dEvents.ScrollThumbRelease}[typ] KeyError: 10144 Traceback (most recent call last): File /home/johnf/dabo/dabo/ui/uiwx/dPanel.py, line 309, in __onWxScrollWin 10070: dEvents.ScrollThumbDrag, 10071: dEvents.ScrollThumbRelease}[typ] KeyError: 10144 Traceback (most recent call last): File /home/johnf/dabo/dabo/ui/uiwx/dPanel.py, line 309, in __onWxScrollWin 10070: dEvents.ScrollThumbDrag, 10071: dEvents.ScrollThumbRelease}[typ] KeyError: 10145 Crap - you mean that they use different IDs for the same event under different platforms? OK, can you run the following for me on Linux (and Windows, too, if you have that handy)? print EVT_SCROLLWIN_TOP, wx.EVT_SCROLLWIN_TOP.typeId print EVT_SCROLLWIN_BOTTOM, wx.EVT_SCROLLWIN_BOTTOM.typeId print EVT_SCROLLWIN_LINEUP, wx.EVT_SCROLLWIN_LINEUP.typeId print EVT_SCROLLWIN_LINEDOWN, wx.EVT_SCROLLWIN_LINEDOWN.typeId print EVT_SCROLLWIN_PAGEUP, wx.EVT_SCROLLWIN_PAGEUP.typeId print EVT_SCROLLWIN_PAGEDOWN, wx.EVT_SCROLLWIN_PAGEDOWN.typeId print EVT_SCROLLWIN_THUMBTRACK, wx.EVT_SCROLLWIN_THUMBTRACK.typeId print EVT_SCROLLWIN_THUMBRELEASE, wx.EVT_SCROLLWIN_THUMBRELEASE.typeId -- Ed Leafe On linux openSUSE 11.2 EVT_SCROLLWIN_TOP 10138 EVT_SCROLLWIN_BOTTOM 10139 EVT_SCROLLWIN_LINEUP 10140 EVT_SCROLLWIN_PAGEUP 10142 EVT_SCROLLWIN_PAGEDOWN 10143 EVT_SCROLLWIN_THUMBTRACK 10144 EVT_SCROLLWIN_THUMBRELEASE 10145 Johnf ___ Post Messages to: Dabo-users@leafe.com 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/201003070954.02206.jo...@jfcomputer.com
Re: [dabo-users] Scroll events
On Sunday 07 March 2010 10:46:15 am Ed Leafe wrote: On Mar 7, 2010, at 12:54 PM, johnf wrote: On linux openSUSE 11.2 EVT_SCROLLWIN_TOP 10138 EVT_SCROLLWIN_BOTTOM 10139 EVT_SCROLLWIN_LINEUP 10140 EVT_SCROLLWIN_PAGEUP 10142 EVT_SCROLLWIN_PAGEDOWN 10143 EVT_SCROLLWIN_THUMBTRACK 10144 EVT_SCROLLWIN_THUMBRELEASE 10145 OK, can you grab the latest and let me know how it's working for you? -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com 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/daac279b-c30b-4ebe-a314-b22ca13b2...@leafe .com Works for me on Linux - did not test on windows. Johnf ___ Post Messages to: Dabo-users@leafe.com 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/201003071052.16426.jo...@jfcomputer.com
Re: [dabo-users] Scroll events
On Sunday 07 March 2010 11:01:44 am Ed Leafe wrote: God, is wxWidgets screwy! +2 Johnf ___ Post Messages to: Dabo-users@leafe.com 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/201003071121.04806.jo...@jfcomputer.com
Re: [dabo-users] record field changed method
On Friday 19 February 2010 12:47:48 pm Nate Lowrie wrote: Is there an easy way to figure out if a field in the current bizobj record has changed? Regards, Nate Try this def showchanges(self, biz=None): if biz is None: biz=self.PrimaryBizobj pkexp='pkid' changes=[] chg=biz._CurrentCursor._mementos chglist=[] for chgrec in chg: chg1=chg[chgrec].copy() chg1['Table']=biz.DataSource chg1[pkexp]=chgrec changes.append(chg1) ret={} bizlist=biz.getChildren() for child in bizlist: ret = self.showchanges(child) if ret: changes.append(ret) return changes You can thank Larry Johnf ___ Post Messages to: Dabo-users@leafe.com 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/201002191351.16699.jo...@jfcomputer.com
Re: [dabo-users] record field changed method
On Friday 19 February 2010 02:02:52 pm Ed Leafe wrote: On Feb 19, 2010, at 3:47 PM, Nate Lowrie wrote: Is there an easy way to figure out if a field in the current bizobj record has changed? changes = biz.getDataDiff() return fieldname in changes -- Ed Leafe Even better Johnf ___ Post Messages to: Dabo-users@leafe.com 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/201002191952.04077.jo...@jfcomputer.com
Re: [dabo-users] Codebook - Dabo, data
On Thursday 18 February 2010 06:09:30 am Mark Stanton wrote: Ed already wrote a nice class for producing SQL to create MySQL tables from a VFP database. Has anyone got anything similar for views? And how about data? All the best Mark Stanton Hi Mark, VFP Views are little more than a SQL statement. So the problem is not getting the statement but converting it to the proper syntax of the DB you are using. For example Postgres requires special constraints/triggers (not sure of the name) to allow inserts, updates, Return, etc... So just copying the Views would do very little beyond knowing the field names and possible joins. Johnf ___ Post Messages to: Dabo-users@leafe.com 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/201002180927.35721.jo...@jfcomputer.com
Re: [dabo-users] echo sql and dabo examples
On Thursday 18 February 2010 02:30:36 pm gioacchinoma...@libero.it wrote: Hi folks, I have a basic question: - how to echo the sql used by dabo ? There are several ways to retrieve the sql statement. self.bizobjName.CurrentSQL .getSQL() self.bizobjName.UserSQL Johnf ___ Post Messages to: Dabo-users@leafe.com 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/201002182049.32191.jo...@jfcomputer.com
[dabo-users] windows7 64 traceback
I get below just opening my forms and dabo tools. Python 2.6, wxPython 2.8.10, latest Dabo Windows 7 6t4 bit c:\dabo\dabo\lib\SimpleCrypt.py:52: UserWarning: WARNING: SimpleCrypt is not sec ure. Please see http://wiki.dabodev.com/SimpleCrypt for more information warnings.warn(WARNING: SimpleCrypt is not secure. Please see http://wiki.dabo dev.com/SimpleCrypt for more information) Traceback (most recent call last): File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py, line 1342 , in Notify self.notify() File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line 1472 0, in Notify self.result = self.callable(*self.args, **self.kwargs) File c:\dabo\dabo\ui\uiwx\dFormMixin.py, line 948, in _setStatusText statusBar = controllingFrame.GetStatusBar() File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py, line 5 42, in GetStatusBar return _windows_.Frame_GetStatusBar(*args, **kwargs) wx._core.PyAssertionError: C++ assertion node != TimerMap().end() failed at .. \..\src\msw\timer.cpp(192) in wxTimerWndProc(): bogus timer id in wxTimerProc Traceback (most recent call last): File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py, line 1342 , in Notify self.notify() File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line 1472 0, in Notify self.result = self.callable(*self.args, **self.kwargs) File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 975, in raiseEvent super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs) File c:\dabo\dabo\lib\eventMixin.py, line 82, in raiseEvent eventData=eventData, *args, **kwargs) File c:\dabo\dabo\dEvents.py, line 29, in __init__ self._insertEventData() File c:\dabo\dabo\dEvents.py, line 60, in _insertEventData eventData[timestamp] = time.localtime() wx._core.PyAssertionError: C++ assertion node != TimerMap().end() failed at .. \..\src\msw\timer.cpp(192) in wxTimerWndProc(): bogus timer id in wxTimerProc Traceback (most recent call last): File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py, line 1342 , in Notify self.notify() File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line 1472 0, in Notify self.result = self.callable(*self.args, **self.kwargs) File c:\dabo\dabo\ui\uiwx\dGrid.py, line 1937, in refresh self._Table._clearCache() ## Make sure the proper values are filled into th e cells File c:\dabo\dabo\ui\uiwx\dGrid.py, line 4583, in _getTable tbl = self.GetTable() File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\grid.py, line 1217, in GetTable return _grid.Grid_GetTable(*args, **kwargs) wx._core.PyAssertionError: C++ assertion node != TimerMap().end() failed at .. \..\src\msw\timer.cpp(192) in wxTimerWndProc(): bogus timer id in wxTimerProc Traceback (most recent call last): File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py, line 1342 , in Notify self.notify() File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line 1472 0, in Notify self.result = self.callable(*self.args, **self.kwargs) File c:\dabo\dabo\ui\uiwx\dFormMixin.py, line 948, in _setStatusText statusBar = controllingFrame.GetStatusBar() File C:\Python26\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py, line 5 42, in GetStatusBar return _windows_.Frame_GetStatusBar(*args, **kwargs) wx._core.PyAssertionError: C++ assertion node != TimerMap().end() failed at .. \..\src\msw\timer.cpp(192) in wxTimerWndProc(): bogus timer id in wxTimerProc ___ Post Messages to: Dabo-users@leafe.com 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/201002142239.27864.jo...@jfcomputer.com
Re: [dabo-users] Linux Screencasting
On Thursday 25 June 2009 06:49:05 am Ed Leafe wrote: RT @RackerHacker: Five ways to make screencasts on a linux box: http://is.gd/1d2lB -- Ed Leafe Ran across another one. http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce-Dmitri-s-open-source-blend-of-productive-computing/Krut-screencasts-made-easy -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906300752.51297.jfabi...@yolo.com
[dabo-users] grid hide a column
Is there a way to hide a column. I want to use the column info in a calc but do not want to display the column. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906301138.39333.jfabi...@yolo.com
Re: [dabo-users] grid hide a column
On Tuesday 30 June 2009 11:45:07 am Paul McNett wrote: johnf wrote: Is there a way to hide a column. I want to use the column info in a calc but do not want to display the column. col.Visible = False You are using a UI control for a business calculation, eh? ;) (can't you just use the underlying dataset to run your calc?) Paul Yes I have been thinking about it a lot. That is using the bizobj to due the calc. It should be noted that if you set the column[idx].Visible = False you no longer have access to the value. So for me using the column for calc is not going to work. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906301229.48883.jfabi...@yolo.com
Re: [dabo-users] grid hide a column
On Tuesday 30 June 2009 01:19:26 pm Paul McNett wrote: johnf wrote: It should be noted that if you set the column[idx].Visible = False you no longer have access to the value. So for me using the column for calc is not going to work. Update to r5283 and then experiment with querying grid.Columns[idx].Value, which you can do whether or not the column is visible. Paul I'm using grid.GetCellValue(row,col) to access the column I'm hiding. That returns '' as the value (should have been True or False). Is there a better way? Let me tell you what I'm doing. I have a column that is changing colors (the background color of the cell) depending on several data fields in the grid. At first I was just using the bool value of the cell to support the cell colors. Then I needed an other value from the row. And now I need a third. Everything is in the row so I was just using the GetCellValue to set the value. But now it looks like I need to create a virtual field to handle the issue. I'm sort of resisting because I already have performance troubles. And of course adding more work for the bizobj to do sounds like not the way to go. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906301500.35933.jfabi...@yolo.com
Re: [dabo-users] grid hide a column
On Tuesday 30 June 2009 03:00:35 pm johnf wrote: On Tuesday 30 June 2009 01:19:26 pm Paul McNett wrote: johnf wrote: It should be noted that if you set the column[idx].Visible = False you no longer have access to the value. So for me using the column for calc is not going to work. Update to r5283 and then experiment with querying grid.Columns[idx].Value, which you can do whether or not the column is visible. Paul I'm using grid.GetCellValue(row,col) to access the column I'm hiding. That returns '' as the value (should have been True or False). Is there a better way? Let me tell you what I'm doing. I have a column that is changing colors (the background color of the cell) depending on several data fields in the grid. At first I was just using the bool value of the cell to support the cell colors. Then I needed an other value from the row. And now I need a third. Everything is in the row so I was just using the GetCellValue to set the value. But now it looks like I need to create a virtual field to handle the issue. I'm sort of resisting because I already have performance troubles. And of course adding more work for the bizobj to do sounds like not the way to go. not so fast I found resched = grid.DataSet[row]['resched'] that works. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906301527.46318.jfabi...@yolo.com
[dabo-users] two detail bands on report.
I took a look at what Roger Lovelock posted on the wiki and noticed that the first report that is displayed appears to have two detail bands. One being the lodge dues and the other payments to date. If I correct how is than done? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906290651.44200.jfabi...@yolo.com
Re: [dabo-users] Complete Applications
On Saturday 27 June 2009 11:40:29 pm Manoharan Durga wrote: Dear All, Can the veterans developing applications using Dabo share their final work in the website? I think it will be really useful for new entrants like myself to study complete applications, to understand how the entire thing has been organised and to learn many intricacies. The data can be just some test data or even need not be there. It is the coding that users will be interested to learn, so that we can understand how the whole thing works. Will really appreciate if a few experts can share their entire application developed using Dabo. Hoping for a positive response Regards, Manoharan I wish I could but I can't because the code I have developed is proprietary and I think I might be sued if I released it. The other issue is I have only been programming in python for two years (and the first year I don't count because I was just testing the waters) and still have much to learn. But if you have a project in mind just present it and I'm sure we will help. BTW: There are several approachs to programming with Dabo. I hand code my screens and others use the ClassDesigner to create screens. And still others use a combination of the two. When I started two years ago ClassDesigner was not very stable so I just taught myself how to hand code the screens. But today ClassDesigner is able to do everything I can do with a screen - just differently in some cases. And still another way is to use the App Wizard that Paul developed. Paul uses modified code based on the App Wizard code he wrote. Then others only use the ClassDesigner to create UI's and don't use the bizobj or data layers. As you can see Dabo is very flexible. It will do the job. Also Dabo eats it's own dog food. ClassDesigner, ReportWriter, AppWizard and several other apps were written using Dabo. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906280725.07264.jfabi...@yolo.com
[dabo-users] Can't deduce HomeDirectory
I getting Can't deduce HomeDirectory as a info message. Of course this does not do any harm. I'm just wondering why it was considered important to record. IOW what was the thinking behind this info message. To avoid the message is it expected that I place my program in the dabo directory? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906270809.58235.jfabi...@yolo.com
Re: [dabo-users] Can't deduce HomeDirectory
On Saturday 27 June 2009 11:23:41 am Paul McNett wrote: You can set HomeDirectory explicitly How can I set it? Below does not work. app = dabo.dApp() app.Icon = pes.ico app.BasePrefKey = PesED app.setAppInfo(appName, PES Education) app.setAppInfo(appShortName, PES Education) app.setAppInfo(Icon, pes.ico) app._setHomeDirectory('/home/johnf/pyProject/pyProject/pespy') -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906271154.07832.jfabi...@yolo.com
Re: [dabo-users] Can't deduce HomeDirectory
On Saturday 27 June 2009 11:54:07 am johnf wrote: On Saturday 27 June 2009 11:23:41 am Paul McNett wrote: You can set HomeDirectory explicitly How can I set it? Below does not work. app = dabo.dApp() app.Icon = pes.ico app.BasePrefKey = PesED app.setAppInfo(appName, PES Education) app.setAppInfo(appShortName, PES Education) app.setAppInfo(Icon, pes.ico) app._setHomeDirectory('/home/johnf/pyProject/pyProject/pespy') also this does not appear to work app.HomeDirectory ='/home/johnf/pyProject/pyProject/pespy' -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906271159.45785.jfabi...@yolo.com
Re: [dabo-users] Can't deduce HomeDirectory
On Saturday 27 June 2009 11:59:45 am johnf wrote: On Saturday 27 June 2009 11:54:07 am johnf wrote: On Saturday 27 June 2009 11:23:41 am Paul McNett wrote: You can set HomeDirectory explicitly How can I set it? Below does not work. app = dabo.dApp() app.Icon = pes.ico app.BasePrefKey = PesED app.setAppInfo(appName, PES Education) app.setAppInfo(appShortName, PES Education) app.setAppInfo(Icon, pes.ico) app._setHomeDirectory('/home/johnf/pyProject/pyProject/pespy') also this does not appear to work app.HomeDirectory ='/home/johnf/pyProject/pyProject/pespy' but this does work app = dabo.dApp(HomeDirectory ='/home/johnf/pyProject/pyProject/pespy') -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906271219.44646.jfabi...@yolo.com
Re: [dabo-users] Linux Screencasting
On Thursday 25 June 2009 10:51:20 am Paul McNett wrote: johnf wrote: On Thursday 25 June 2009 06:49:05 am Ed Leafe wrote: RT @RackerHacker: Five ways to make screencasts on a linux box: http://is.gd/1d2lB -- Ed Leafe I have used RecordMyDesktop. The problem is the size of the file that is created. 60 meg in my case. I could not figure out how both you and Paul were able to produce screencast with very small sizes compared to what I was getting. vnc2swf Paul Paul, Can I assume using vnc2swf allowed you lower the file size? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906261035.25408.jfabi...@yolo.com
Re: [dabo-users] dHtmlBox RegID problem
On Friday 26 June 2009 10:32:35 am Mike Mabey wrote: Hi everyone, I've got an app that has a dPageFrame separating the various functions. One of the pages is dedicated as a Help tab. I discovered the dHtmlBox widget and thought this might be a good way to display a help page inside the app. The problem is I've been trying to link the dHtmlBox widget to a locally stored .htm file with no success. Here's what I've tried: - Putting the file name inthe Source property. Then I figured out that this was for displaying HTML source code. - Putting the file name in the Page property. According to what I understand from the documentation, this should have worked, but the widget kept trying to find http://help.htm - Setting the dHtmlBox's Page property to os.path.join(os.getcwd(), 'help.htm') when the form initializes. The problem I ran into doing it this way was setting the RegID of the dHtmlBox. I don't know why, but in ClassDesigner, I could only type numbers and the letter 'e' in the RegID field of the Object Info window. I tried setting it manually in the .cdxml file, but when I ran the code, I got the following error: Traceback (most recent call last): File PreferenceManager.py, line 22, in module main() File PreferenceManager.py, line 15, in main app.start() File C:\Python25\lib\site-packages\dabo\dApp.py, line 372, in start self.setup() File C:\Python25\lib\site-packages\dabo\dApp.py, line 328, in setup self.initUIApp() File C:\Python25\lib\site-packages\dabo\dApp.py, line 364, in initUIApp self.uiApp.setup() File C:\Python25\lib\site-packages\dabo\ui\uiwx\uiApp.py, line 412, in setup frm = self.dApp.MainForm = dabo.ui.createForm(mfc) File C:\Python25\lib\site-packages\dabo\ui\uiwx\__init__.py, line 1145, in createForm frm = cls(*args, **kwargs) File c:\users\ecegra~1\appdata\local\temp\tmpeow3q3.py, line 9, in __init__ super(dForm_31058, self).__init__(parent=parent, attProperties=attProperties, *args, **kwargs) File C:\Python25\lib\site-packages\dabo\ui\uiwx\dForm.py, line 931, in __init__ BaseForm.__init__(self, preClass, parent, properties, attProperties, *args,**kwargs) File C:\Python25\lib\site-packages\dabo\ui\uiwx\dForm.py, line 44, in __init__ fm.dFormMixin.__init__(self, preClass, parent, properties, attProperties, *args, **kwargs) File C:\Python25\lib\site-packages\dabo\ui\uiwx\dFormMixin.py, line 89, in __init__ attProperties, *args, **kwargs) File C:\Python25\lib\site-packages\dabo\ui\uiwx\dPemMixin.py, line 86, in __init__ self._initProperties() File C:\Python25\lib\site-packages\dabo\dObject.py, line 177, in _initProperties self.initProperties() File c:\users\ecegra~1\appdata\local\temp\tmpeow3q3.py, line 585, in initProperties self.Form.HelpPage.Page = tmp AttributeError: 'NoneType' object has no attribute 'HelpPage' Obviously, the string I set as the RegID was 'HelpPage'. I am trying to change the property with the following code: def initProperties(self): self.ShowStatusBar = False tmp = os.path.join(os.getcwd(), 'help.htm') print Opening +str(tmp) self.Form.HelpPage.Page = os.path.join(os.getcwd(), 'help.htm') The initProperties() method belongs to the dForm object. I'm not sure if that's where I should have put it, but I was trying a few different places and none of them seemed to make any more sense or work any better than this. I'm sorry this is such a complicated problem, but any help you can offer would be very appreciated. Oh, and by the way, I'm running Python 2.5 in Win Vista Pro under revision 5270. Thanks, Mike M. Mike, I can't confirm entering the RegID problem with ClassDesigner. I had no trouble. Of course I tested on Linux and NOT windows (maybe a vista thing). Can you post a simple test case? I'll test on XP and Linux. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906261050.26727.jfabi...@yolo.com
Re: [dabo-users] dHtmlBox RegID problem
On Friday 26 June 2009 12:10:02 pm Mike Mabey wrote: On Fri, Jun 26, 2009 at 11:50 AM, johnf jfabi...@yolo.com wrote: Mike, I can't confirm entering the RegID problem with ClassDesigner. I had no trouble. Of course I tested on Linux and NOT windows (maybe a vista thing). Can you post a simple test case? I'll test on XP and Linux. John, Thanks for replying. For some reason, this problem seems to be unique to the dHtmlBox object. Were you testing it on a dHtmlBox object, or something else? If you still have no trouble changing it, let me know and then tell me what will be useful information for me to post as a simple test case so we can get this figured out. Thanks, Mike M. I created a form that contained a pageframe with three tabs. I then added a vert-sizer to one of the tabs. Next just add an dHtmlBox to the vert-sizer. Then I entered a RegID. It took chars without issue. I saved it and re-opened it. I then changed the RegID. All worked. Try doing the same thing and post it. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906261251.28790.jfabi...@yolo.com
Re: [dabo-users] Linux Screencasting
On Thursday 25 June 2009 06:49:05 am Ed Leafe wrote: RT @RackerHacker: Five ways to make screencasts on a linux box: http://is.gd/1d2lB -- Ed Leafe I have used RecordMyDesktop. The problem is the size of the file that is created. 60 meg in my case. I could not figure out how both you and Paul were able to produce screencast with very small sizes compared to what I was getting. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906250703.19802.jfabi...@yolo.com
[dabo-users] where does Dabo store the data
Hi, Where does Dabo maintain the data it retrieves from a postgres database? Is it in a SQLite table? If so where is it created. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906251922.59070.jfabi...@yolo.com
Re: [dabo-users] where does Dabo store the data
On Thursday 25 June 2009 07:52:33 pm Ed Leafe wrote: On Jun 25, 2009, at 9:22 PM, johnf wrote: Where does Dabo maintain the data it retrieves from a postgres database? Is it in a SQLite table? If so where is it created. It's in a tuple of dicts. It's not in a local database unless you put it there. -- Ed Leafe Thanks - I then - doubt it the cause of a slow down. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906252001.16908.jfabi...@yolo.com
[dabo-users] a checkListCtrlMixin
I would like to have a listcontrol that has column headers like a grid but is a listcontrol with checkboxes. wx has CheckListCtrlMixin is there anything in Dabo that I can use? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906241328.38196.jfabi...@yolo.com
Re: [dabo-users] a checkListCtrlMixin
On Wednesday 24 June 2009 01:48:31 pm Paul McNett wrote: johnf wrote: I would like to have a listcontrol that has column headers like a grid but is a listcontrol with checkboxes. wx has CheckListCtrlMixin is there anything in Dabo that I can use? dCheckList http://paul.dabodev.com/doc/api/dabodoc/dabo.ui.uiwx.dCheckList.dCheckList. html Paul Does dCheckList have headers? I don't see where I can set them. I don't want a grid because of the nice easy interface of the list control keyvalues. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906241357.25588.jfabi...@yolo.com
Re: [dabo-users] a checkListCtrlMixin
On Wednesday 24 June 2009 01:59:31 pm Paul McNett wrote: How many headers do you need? Why can't you just put a label above the checklist? Or how about using the first row as the header? I'm doing that now but it not as good as having a header. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906241408.33668.jfabi...@yolo.com
Re: [dabo-users] a checkListCtrlMixin
On Wednesday 24 June 2009 02:11:24 pm Paul McNett wrote: johnf wrote: On Wednesday 24 June 2009 01:59:31 pm Paul McNett wrote: How many headers do you need? Why can't you just put a label above the checklist? Or how about using the first row as the header? I'm doing that now but it not as good as having a header. What are you going to say in the header? It isn't as if you have different columns that mean different things... Paul Actually I'm using a long string that contains several fields (for the Choices). In this case the date, course, location, and session ID. I considered a grid but it is over kill and list controls are easy to work with. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906241420.46334.jfabi...@yolo.com
Re: [dabo-users] a checkListCtrlMixin
On Wednesday 24 June 2009 02:37:45 pm Ed Leafe wrote: On Jun 24, 2009, at 3:28 PM, johnf wrote: I would like to have a listcontrol that has column headers like a grid but is a listcontrol with checkboxes. wx has CheckListCtrlMixin is there anything in Dabo that I can use? You could modify the dListControl to do what you want; that's basically what the wx.CheckListCtrl does. The wx.ListCtrl is a tremendously powerful and hairy beast to deal with. We've wrapped some of the basic functionality in dListControl, but the opportunity is there for someone to add more. -- Ed Leafe OK thanks - I'll look into it. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906241457.24209.jfabi...@yolo.com
[dabo-users] problem with requery taking a long time
I have a some what complex form - 15 parent/child/grandchild relations. To clear my screen or reset the data I set the PrimaryBizobj.setWhereClause('1=0') and then do a Form.requery(). The requery() resets the form controls to blank values. The problem is one of performance. Sometimes the requery() takes a half second but many times it takes as much as 12 seconds. Waiting 12 seconds is a long time. Does anyone have a suggestion on improving the time. Or how I might determine the cause. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906100257.02357.jfabi...@yolo.com
Re: [dabo-users] problem with requery taking a long time
On Wednesday 10 June 2009 06:52:52 am Ed Leafe wrote: On Jun 10, 2009, at 8:09 AM, johnf wrote: The fact that the Postgres log reports the same actual cost for each of the requerys (.5 vs 12 seconds). Implies that the problem is else where. Any chance you have an idea where to look? I'd profile the method that you call to do this 'clearing'. That will show you where the slowdown occurs. -- Ed Leafe Larry and I have several hours into the debug of this issue without any success. We have come to the conclusion that it is NOT the backend DB. The Form.requery() is finished in under a second. But the form screen refresh takes as much as 40 seconds to complete (runs faster on windows). Top reports that python has gone to 100% until the form is cleared. We now need more advise. We tried to turn on the event log but could not figure out what statements were required. We tried: app.LogEvents = ('All') dabo.eventLogging = True But nothing appears in the standard out nor is a log file created. We have no idea where to look next! There are no tracebacks, any error message displayed anywhere. Need help! -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906101302.06398.jfabi...@yolo.com
Re: [dabo-users] problem with requery taking a long time
On Wednesday 10 June 2009 01:09:41 pm Ed Leafe wrote: On Jun 10, 2009, at 4:02 PM, johnf wrote: We have no idea where to look next! There are no tracebacks, any error message displayed anywhere. What was the result of the profiling? -- Ed Leafe The profiler is reporting less than a second in time. The delay happens after the form clear event is finshed - but before the form is actually refreshed/cleared. A Form.requery() has completed. So the following has occurred: self.afterRequery() self.update() self.refresh() But the screen is not cleared. Just wondering if dabo.ui.CallAfter is involved. Profile for: onClear 117052 function calls (114933 primitive calls) in 1.644 CPU seconds Ordered by: internal time, call count ncalls tottime percall cumtime percall filename:lineno(function) 10.8090.8091.2961.296 _windows.py:701(ShowModal) 38470.1610.0000.4400.000 eventMixin.py:32(raiseEvent) 38450.1260.0000.1440.000 __init__.py:350(getEventData) 1220.0990.0010.0990.001 propertyHelperMixin.py:252 (getPropertyList) 2023/70.0900.0000.1520.022 dPemMixin.py:1106(setAll) 38470.0440.0000.1880.000 dEvents.py:54(_insertEventData) 406370.0400.0000.0400.000 dEvents.py:108(_getContinue) 38460.0270.0000.4670.000 dPemMixin.py:937(raiseEvent) 38470.0230.0000.2110.000 dEvents.py:17(__init__) 37310.0200.0000.4680.000 dPemMixin.py:523(__onWxIdle) 3010.0180.0000.0180.000 _core.py:9946 (GetBackgroundColour) 39400.0110.0000.0110.000 _core.py:4431(Skip) 38450.0100.0000.0100.000 _core.py:4368(GetEventType) 38450.0100.0000.0210.000 __init__.py:326(continueEvent) 19670.0080.0000.0150.000 dPemMixin.py:1885(_getChildren) 38470.0080.0000.0080.000 eventMixin.py:331 (_getEventBindings) 38450.0070.0000.0070.000 _core.py:4403(GetId) 19670.0060.0000.0060.000 _core.py:9330(GetChildren) 1220.0060.0000.0110.000 dCursorMixin.py:49 (_initProperties) 1220.0060.0000.1090.001 dObject.py:36(__init__) 80.0060.0010.0060.001 extras.py:85(execute) 610.0060.0000.0060.000 dBizobj.py:189(_getCursorClass) 3660.0050.0000.0180.000 dCursorMixin.py:2377 (_getAuxCursor) 30.0040.0010.0050.002 _windows.py:540(SetStatusText) 9200.0040.0000.0060.000 string:1(module) 20580.0030.0000.0030.000 _core.py:8299(next) 6060.0030.0000.0030.000 _controls.py:1784(IsEditable) 170.0030.0000.0030.000 _core.py:9906 (SetBackgroundColour) 6880.0030.0000.0040.000 dCursorMixin.py:2556 (_getRowNumber) 2500.0030.0000.0120.000 dBizobj.py:1466(getFieldVal) 30.0030.0010.0030.001 _core.py:9736(Update) 610.0020.0000.1460.002 dBizobj.py:142(createCursor) 2500.0020.0000.0160.000 dBizobj.py:935 (getParentLinkValue) 1300.0020.0000.0020.000 dDataSet.py:39(__init__) 19600.0020.0000.0020.000 _core.py:8318(__len__) 2880.0020.0000.0210.000 dPemMixin.py:1742(_getBackColor) 2800.0020.0000.0040.000 dCursorMixin.py:812(getFieldVal) 10.0020.0020.0020.002 _windows.py:2901(__init__) 9200.0020.0000.0020.000 dObject.py:271(_getBaseClass) 38510.0020.0000.0020.000 _core.py:4359(lambda) 10630.0020.0000.0020.000 dCursorMixin.py:2548 (_getRowCount) 6060.0020.0000.0050.000 dTextBoxMixin.py:218 (_getReadOnly) 4450.0020.0000.0050.000 dBizobj.py:2250(_getRowNumber) 1130.0020.0000.0020.000 _controls.py:1968(SetEditable) 8100.0020.0000.0020.000 dBizobj.py:2004 (_getCurrentCursor) 4270.0020.0000.0020.000 dCursorMixin.py:2403 (_setBackendObject) 155/1010.0020.0000.1580.002 dBizobj.py:1315 (setCurrentParent) 610.0020.0000.0230.000 dBizobj.py:1928 (_syncCursorProps) 1220.0010.0000.1230.001 dBizobj.py:193(__init__) 1220.0010.0000.1200.001 dCursorMixin.py:25(__init__) 1220.0010.0000.0010.000 dObject.py:170(_beforeInit) 97/760.0010.0000.0070.000 dBizobj.py:1193(isAnyChanged) 6050.0010.0000.0010.000 dCursorMixin.py:2400 (_getBackendObject) 1220.0010.0000.0010.000 dCursorMixin.py:140(clearSQL) 610.0010.0000.016
Re: [dabo-users] Problem with SQLite
On Monday 08 June 2009 05:04:37 pm Roger Lovelock wrote: self.requery() self.cancel() self.new() Ed shouldn't that still work? self.requery() # resets the data self.cancel() # cancels any changes self.new() # a new record is created. But you don't need the requery or cancel. Just do the new(). Dabo will take care of the issue. If you are having a screen refresh issue (like the grid is not displaying your newly saved record) then you can issue an self.update(). That said try to avoid doing that. I normally get away with using self.grid.refresh(). But I also have been forced to use an update(). -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906081712.58029.jfabi...@yolo.com
Re: [dabo-users] Problem with SQLite
On Monday 08 June 2009 05:17:17 pm Roger Lovelock wrote: As I said in my first email - I tried that - but got an error message saying unicode expected - timedate received. The requery seems to be needed for the datatype of the field to be set correctly in the bizObj. Screen refresh is not an issue - everything appears correctly on the screen. The form just has textboxes for the fields of the record and add and cancel buttons (plus a couple of drop downs to select account codes etc from). -- From: johnf jfabi...@yolo.com Sent: Tuesday, June 09, 2009 10:12 AM To: Dabo Users list dabo-users@leafe.com Subject: Re: [dabo-users] Problem with SQLite On Monday 08 June 2009 05:04:37 pm Roger Lovelock wrote: self.requery() self.cancel() self.new() Ed shouldn't that still work? self.requery() # resets the data self.cancel() # cancels any changes self.new() # a new record is created. But you don't need the requery or cancel. Just do the new(). Dabo will take care of the issue. If you are having a screen refresh issue (like the grid is not displaying your newly saved record) then you can issue an self.update(). That said try to avoid doing that. I normally get away with using self.grid.refresh(). But I also have been forced to use an update(). -- John Fabiani OK so when you issue a Form.new() you get the error? Or is it during the Form.save()? A possible work around would be to create a beforeSave() and adjust the date field as required. But this sounds like a bug. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906081732.55727.jfabi...@yolo.com
Re: [dabo-users] RowNumChanged event
On Tuesday 02 June 2009 10:42:52 am lalo...@charter.net wrote: How do we bind the RowNumChanged event to a grid? Using self.grid_obj_id.bindEvent(dabo.dEvents.RowNumChanged, self.dosomething) does nothing. We want to update some values upon grid row changes. Thanks, Larry Long Well not exactly nothing. dGrid -__onRowNumChanged() does get called. What does not happen is 'self.dosomething' never gets called. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906030700.58768.jfabi...@yolo.com
[dabo-users] easy way to append dataset to dataset
I have a need to create a copy some data from a current dataset and insert it into a new dataset. Is there an easy way to do it? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200906030711.56212.jfabi...@yolo.com
Re: [dabo-users] Does she know something we don't know?
On Thursday 28 May 2009 06:34:37 pm Ed Leafe wrote: http://twitter.com/AnitaBusby/statuses/1953577160 -- Ed Leafe LOL - man I sure hope not! -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905281910.19435.jfabi...@yolo.com
[dabo-users] how to dis-able dabo.ui.dBitmapButton
Is there a way to set dabo.ui.dBitmapButton.Enabled = False I thought that was the correct way to disable the button. But I'm getting the below traceback. Traceback (most recent call last): File input, line 1, in module File /home/johnf/downloads/dabo/dabo/ui/uiwx/dPemMixin.py, line 1950, in _setEnabled self.Enable(val) TypeError: 'bool' object is not callable -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905271205.27999.jfabi...@yolo.com
Re: [dabo-users] how to dis-able dabo.ui.dBitmapButton
On Wednesday 27 May 2009 02:31:38 pm Ed Leafe wrote: On May 27, 2009, at 2:05 PM, johnf wrote: Is there a way to set dabo.ui.dBitmapButton.Enabled = False I thought that was the correct way to disable the button. But I'm getting the below traceback. Traceback (most recent call last): File input, line 1, in module File /home/johnf/downloads/dabo/dabo/ui/uiwx/dPemMixin.py, line 1950, in _setEnabled self.Enable(val) TypeError: 'bool' object is not callable Can you show the code that is doing this? I just re-checked, and that's working fine. Please include the version info, too. -- Ed Leafe Platform: GTK Python Version: 2.5.1 on linux2 Dabo Version: Version 0.9.1; Revision 5228M UI Version: 2.8.9.1 on wxGTK (gtk2) Of course the form in question has plenty of controls etc. But below is an example of how the control is created (it is the real code) gs = dabo.ui.dGridSizer(MaxCols = 6, HGap = 3, VGap = 3) cfindbtn=dabo.ui.dBitmapButton(self, TabStop = False, RegID = btnCaseID, Picture = find, BorderWidth = 1, BorderColor = blue) cfindbtn.bindEvent(dEvents.Hit, self.Form.lookup) gs.append(cfindbtn) self.btnCaseID.Enabled = False The above code causes the traceback. I have about six of these example buttons on my form. All have caused the problem. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905271602.05671.jfabi...@yolo.com
Re: [dabo-users] how to dis-able dabo.ui.dBitmapButton
On Wednesday 27 May 2009 04:02:05 pm johnf wrote: On Wednesday 27 May 2009 02:31:38 pm Ed Leafe wrote: On May 27, 2009, at 2:05 PM, johnf wrote: Is there a way to set dabo.ui.dBitmapButton.Enabled = False I thought that was the correct way to disable the button. But I'm getting the below traceback. Traceback (most recent call last): File input, line 1, in module File /home/johnf/downloads/dabo/dabo/ui/uiwx/dPemMixin.py, line 1950, in _setEnabled self.Enable(val) TypeError: 'bool' object is not callable Can you show the code that is doing this? I just re-checked, and that's working fine. Please include the version info, too. -- Ed Leafe Platform: GTK Python Version: 2.5.1 on linux2 Dabo Version: Version 0.9.1; Revision 5228M UI Version: 2.8.9.1 on wxGTK (gtk2) Of course the form in question has plenty of controls etc. But below is an example of how the control is created (it is the real code) gs = dabo.ui.dGridSizer(MaxCols = 6, HGap = 3, VGap = 3) cfindbtn=dabo.ui.dBitmapButton(self, TabStop = False, RegID = btnCaseID, Picture = find, BorderWidth = 1, BorderColor = blue) cfindbtn.bindEvent(dEvents.Hit, self.Form.lookup) gs.append(cfindbtn) self.btnCaseID.Enabled = False The above code causes the traceback. I have about six of these example buttons on my form. All have caused the problem. Two clues; 1. I noticed that I was losing the blue border around the button. 2. I noticed I had attempted to set a ReadOnly on all the buttons. I removed both and it seems to work? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905271610.25374.jfabi...@yolo.com
Re: [dabo-users] how to dis-able dabo.ui.dBitmapButton
On Wednesday 27 May 2009 05:49:26 pm Ed Leafe wrote: On May 27, 2009, at 6:10 PM, johnf wrote: Two clues; 1. I noticed that I was losing the blue border around the button. 2. I noticed I had attempted to set a ReadOnly on all the buttons. I removed both and it seems to work? I'm guessing that this must be a Gtk issue. I ran your exact code, and got a button with a blue border that was disabled. Can someone with Gtk handy try his code and confirm that it throws an error? -- Ed Leafe That might be - I did not test it on windows. But for now I have it working and I never liked the blue border anyway. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905271754.17818.jfabi...@yolo.com
Re: [dabo-users] Report Runtime
On Wednesday 27 May 2009 06:22:15 am Ricardo Aráoz wrote: I've done something similar under VFP. I have a form with a label, a textbox and a list box beneath them with the names and contents of all the pertinent filter variables. As the user scrolls through the list box the label takes the value of the highlighted variable and the textbox the corresponding content, if the user wants to change the value of a filter variable he does so in the textbox, where the data is validated properly (mask is in effect to filter input), pre-processing is done and results converted to proper type are fed to appropriately named property. Once the ok button is pressed the query is executed with values taken from these properties. This schema allows me validation against other defined variables (just validate the corresponding properties). The filter variable names, pre-processing, validation, error message (when validation is not true), type, mask, visibility (so I can use variables not accessible to the user), etc. are stored in a table. Sounds good! So can I assume that when a range is required that there are var from and var to in the list? In our case the idea was to have dynamic controls appear as required. On the left we have a dropdown with single, range, or 'all' for each of the required params. If the user selects single only one (textbox, datebox, or masktextbox) control appears, if 'range' is selected then two controls appear. There is nothing to do if 'all' is used. The SQL then uses the user input to retrieve data. The problem of validation is of concern. Unlike VFP Dabo (in general) expects bizobj's to handle validation. In this case there is no bizobj. So we haven't got it down pat for the moment. But we are providing the user lookup tools to pick the params. For example if the user wanted to pick a customer they would click on the lookup button and a pick-grid would appear listing the customers. This goes a long ways in preventing bad input. Our biggest issue is the report interface is very dependent on tables, and our home grown classes. The tables (meta data) I don't mind. They don't have to be on a postgres server. We could have used SQLite. But using our home grown classes are of concern. Not that they don't work - they do. Just that when we wrote them we were less than knowledgeable when it came to Dabo and python in general. But we are getting better daily. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905271917.57371.jfabi...@yolo.com
Re: [dabo-users] Report Runtime
On Monday 25 May 2009 05:33:27 pm Roger Lovelock wrote: Hi All, A thought I had! The most common enhancement to my dabo application is new report formats (changes or additions). Because of the nature of the report writer and the way reports are run it means adding code to the main app and redistributing an updated version to all users. My thought was that if a generalised report runner was included in my app I would only need to distribute text and/or xml files to add new reports. To explain - if I had an xml or text file per report which included the descriptive name of the report, connection name, sql statement and report definition file name then a generalised routine (optionally stand-alone or alternatively embedded in the application) could do the following :- read all report text files display a drop down list of available reports (descriptive name) upon selection of a list item get the connection create a dataset from the sql statement run the specified report and display the pdf To add a new report would just need the relevant report text file, cdxml file and rfxml files loaded in the app directory. Of course two other thoughts come to mind - all the data in the report text file could be included in the rfxml file. - A stand-alone user friendly ad-hoc report generator could be developed from this base utilising the report designer as a starting point. Has anyone else had thoughts or done anything along these lines? Any suggestions? Roger Larry and I are doing something very similar. Although, your description does not cover all the issues. For example you need more than just a dropdown to select a report. You need a way to interact with the user. Most reports will need input from the user - such as date ranges or client names. IOW the params for the sql. BTW that is not as easy as it may sound. Dynamically, displaying textboxes, date boxes, spinners, dropdowns can be a pain and remember that you can have ranges and may need to provide validation along with lookups for each control. That said, are you going to limit the reporting tool to PDF's? Most apps these days need to email, create spreadsheets, SMS text?, and of course printing. BTW how would you handle the connection problem for remote users? If the connection is within the report then it would be likely that the connection would be wrong for the remote users. I'm not shooting down the idea. I like it (or I wouldn't be doing something similar). But there is much more than what you described required. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905260720.12979.jfabi...@yolo.com
Re: [dabo-users] SQLite Problem
On Monday 25 May 2009 06:28:14 pm Roger Lovelock wrote: Not sure if this is a problem with dabo, or my code - wondering if anyone else has a similar problem :- I have a transaction table with a date field - default value is today. Whenever I enter a new transaction the date on the first record in the table is updated to today, even though I have not edited that record. My form only allows new transactions to be entered - the after init routine ending with self.new(). Any suggestions where I may be going wrong? Thanks Roger This is a total guess because (at least for me) you have not provided enough information to do anything else. Are you in fact getting a new record in the table. IOW if you start out with 10 records - did you get 11 records after the save? If not you are most likely updating the same record over and over again. I have not worked with SQLite very often but does it need a commit, should you supply a primary key (auto-increment available?), Turn off/on some Dabo setting in the bizobj? Like setting NonUpdateFields. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905260734.13491.jfabi...@yolo.com
Re: [dabo-users] Report Runtime
On Tuesday 26 May 2009 03:15:42 pm Roger Lovelock wrote: I guess I have a more simplistic situation than most in that my app is a single user desktop app - so I have no complications with remote users and connections, though I understand where you are coming from. In my situation most reports are either viewed or printed - so displaying the report in a pdf viewer is adequate as I can view, print or save a file (for attachment to an email) from there - I'm intending to keep things very simple initially and possibly develop further as needed. You have a valid point re user input and the thought had crossed my mind. Again, I have a simplistic situation - a membership system - where typically I want all records listed in a report eg all members who haven't paid their annual dues, or all members with a birthday this month, so I don't typically get much user input to select in reports. Having said that, a more general and flexible tool is obviously better than a simplistic one that only fits one applications situation, and probably inevitably the requirements will expand over time anyway. It would seem unproductive to develop essentially the same thing twice. How advanced is your development and would you be willing to share the fruits of your labor? Regards Roger -- From: johnf jfabi...@yolo.com Sent: Wednesday, May 27, 2009 12:20 AM To: Dabo Users list dabo-users@leafe.com I would not mind but it wouldn't help you even a little. Everything, we have depends on so many other classes and tables that it would be useless to you and others. Building a generic reporting tool as I described is not easy. I may have something after the fifth or sixth rewrite. But for now - it's not much help to others. Even accepting report criteria from the user depends on to many of our classes. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905261722.48034.jfabi...@yolo.com
Re: [dabo-users] 'no module named aui' 'dApp ' object has no attribute 'uiApp'
On Thursday 21 May 2009 06:57:49 am johnf wrote: I have been playing/testing Dabo on Ubuntu 9.04 and discovered several interesting things. 1. Even after installing wxPython (see below) I can not get Dabo and parts of wxPython to work correctly using python 2.6. I had trouble with grids, and a special dialog I subclassed from dOkCancelDialog. 2. Using the install software program (can't recall the name) I was able to install python 2.5. Using the command line to run wxPython with python 2.5. 3. wxPython 2.8.9.2 is what is installed. And it installs it self in a python 2.5 type directory. But python 2.6 appeared to have access too. I'm not sure how that works. But it did. It was strange because I installed wxPython before installing python 2.5. And without changing anything wxPython worked with the new python 2.5. That surprized me. 4. Attempting to use a dabo.pth file required that I place the file in a different directory from my past experiences. Normally, I just use the site-packages of the python I'm using. But that did not work. There is a disutils (or some spelling that started with a 'd' anyway) that I placed the 'pth' file and all worked. Like I said I was just playing with Ubuntu on my laptop while I was watching TV. But I did get Ubuntu 9.04 and Dabo working using pyhton 2.5. It should be obvious that I have lots to learn about Ubuntu. This distro a different animal. I found a little item on the wxPython list Under Jaunty things are different, because every wxpython package adds a wx-2.[68]-gtk2-unicode.pth to /usr/lib/python2.6/dist-packages, so - if I understand it correctly - on a import wx Python chooses alphabetically, thus the 2.6 version.. Hope this helps. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905221144.59019.jfabi...@yolo.com
Re: [dabo-users] 'no module named aui' 'dApp ' object has no attribute 'uiApp'
On Friday 22 May 2009 12:08:19 pm Ed Leafe wrote: On May 22, 2009, at 1:44 PM, johnf wrote: Under Jaunty things are different, because every wxpython package adds a wx-2.[68]-gtk2-unicode.pth to /usr/lib/python2.6/dist-packages, so - if I understand it correctly - on a import wx Python chooses alphabetically, thus the 2.6 version.. If they use distutils, though, it's supposed to use the most recent version. -- Ed Leafe I'm not sure what is happening with ubuntu 9.04. I just thought this might help. I noticed several things that caught me by surprise when trying to get Dabo to work. For example I installed python 2.5 after installing wxPython - but it stilled worked with 2.5 without me doing anything. I'm guessing but it looks like wxPython was installed for all the available pythons (including 2.4?). BTW my Dabo.pth file went into 'dist-packages'. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905221233.38033.jfabi...@yolo.com
Re: [dabo-users] 'no module named aui' 'dApp ' object has no attribute 'uiApp'
On Wednesday 20 May 2009 08:52:53 pm Ed Leafe wrote: On May 20, 2009, at 10:19 PM, Mike wrote: 2. the initial error seems to be the missing wx.aui. I can find an aui.py in lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx and lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx What happens when you open a Python session in the terminal, and then type: import wx import wx.aui -- Ed Leafe I have been playing/testing Dabo on Ubuntu 9.04 and discovered several interesting things. 1. Even after installing wxPython (see below) I can not get Dabo and parts of wxPython to work correctly using python 2.6. I had trouble with grids, and a special dialog I subclassed from dOkCancelDialog. 2. Using the install software program (can't recall the name) I was able to install python 2.5. Using the command line to run wxPython with python 2.5. 3. wxPython 2.8.9.2 is what is installed. And it installs it self in a python 2.5 type directory. But python 2.6 appeared to have access too. I'm not sure how that works. But it did. It was strange because I installed wxPython before installing python 2.5. And without changing anything wxPython worked with the new python 2.5. That surprized me. 4. Attempting to use a dabo.pth file required that I place the file in a different directory from my past experiences. Normally, I just use the site-packages of the python I'm using. But that did not work. There is a disutils (or some spelling that started with a 'd' anyway) that I placed the 'pth' file and all worked. Like I said I was just playing with Ubuntu on my laptop while I was watching TV. But I did get Ubuntu 9.04 and Dabo working using pyhton 2.5. It should be obvious that I have lots to learn about Ubuntu. This distro a different animal. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905210657.49662.jfabi...@yolo.com
Re: [dabo-users] ReportDesigner/Writer - Date formats
On Thursday 21 May 2009 07:30:06 pm larry wrote: Paul, How do you set the date format for a date type field? I have.. dabo.settings.dateFormat = %m/%d/%Y declared but the report shows in -mm-dd format. Thanks, Larry Just use the something like the following in the expr for the field. datetime.date.today().strftime(%d.%m.%Y) -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905212027.22767.jfabi...@yolo.com
Re: [dabo-users] use a virtual field in the method of a second virtual field
Yes, you can use the results of virtual fields in other virtual fields. You may just call getSubTotal() directly though. What is the correct way to handle this? Be aware that the virtual fields will calc every time the grid asks for a refresh. Paul This is what I ended doing (thanks to Larry's help). I'm not sure this is the correct way to handle the problem. But I knew I wanted to keep everything in the bizobj (don't want violate one of Ed's rules - don't mix UI and Bizobjs). But I am concerned that the order of the calls is important and maybe timing. Although, I have not seen any issues. If anyone see anything negative about my way - Please let me know. I added two attributes for the child bizobj (_totalrec, _balance). I then used one virtual field and one method to set the values correctly. In the child table that contains all of my recieved payments. I did the following: def InitProperties(self): self._totalrec = 0 self._balance = 0 def gettotalRec(self): tempCur = self.getTempCursor() tempCur.execute(Select sum(amt_rec) as totalrec from escoursepayments where fk_enroll = %s % self.MainForm.esenroll.Record.pkid) try: myret = tempCur.Record.totalrec self._totalrec = myret self._balance = self.Parent.Record.course_cost - myret except: myret = 0 self._totalrec = myret self._balance = self.Parent.Record.course_cost return myret def getBalance(self): try: myret = self._balance except: myret = 0 return myret On the Form I have the following: hs.append(dabo.ui.dLabel(self,Caption='Total Rec'), halign=right) hs.append(dabo.ui.dTextBox(self,Width=175,ReadOnly=True,RegID='courseRecID',DataSource='public.escoursepayments',DataField='totalrec')) hs.append(dabo.ui.dLabel(self,Caption='Balance'), halign=right) hs.append(dabo.ui.dTextBox(self,Width=175,ReadOnly=True,RegID='balanceID',DataSource=self.Form.escoursepayments, DataField='getBalance')) The first DataField (totalrec) uses the virtual field. And the second field uses a DataSource method (getBalance) to retrieve the data. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905200936.57771.jfabi...@yolo.com
[dabo-users] use a virtual field in the method of a second virtual field
I have classic grid that contains a list of payments made on account. The grid is populated from the bizobj payments which is a child of the client. I need the subtotal and the balance. Total amt - subtotal = balance The bizobj has addField('amt_rec') addField('fk_client') I now have to sum(amt_rec) where fk_client = somePkOfClient. VirtualFields = {subtotal: self.getSubTotal} def getSubTotal(self): tempCur=self.getTempCursor() tempCur.execute(Select sum(amt_rec) as totalrec from payments where fk_client = %s % client_pkid) return tempCur.Record.totalrec subtotal has the correct figure. Can I use subtotal in the next virtual field? def getBalance(self): return total - self.subtotal What is the correct way to handle this? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905192216.57669.jfabi...@yolo.com
Re: [dabo-users] Using several bizobjs on one form
On Monday 18 May 2009 09:59:50 am Ed Leafe wrote: The params are still passed; you just have to include the param in your SQL. Could explain a little further. Thanks -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905181009.32814.jfabi...@yolo.com
Re: [dabo-users] Reportwriter architecture - why ReportLab vs. OpenOffice Writer?
On Monday 18 May 2009 05:54:19 pm Paul McNett wrote: pyt...@bdurham.com wrote: Can you share your thoughts on why you chose to base the Dabo report writer off of ReportLab vs. the Open Office word processor? Well it wasn't either/or. There are other options out there too. I simply chose something easy to use, written in python, that gave the desired output (pdf). I think there's room to develop different outputs, including open office writer. The one I've been thinking about is to output to wx.PostscriptDC and wx.PaintDC, to print directly to a printer and to display on a wx.Window, respectively. My assumption is that ReportLab removes the dependency of a large application like Writer. But Writer might(?) allow you to generate Open Office compatible markup that shifts calculations for group height, page breaks, headers, footers, etc to the Writer engine vs. your code? It would be a different style of output, sure. I haven't tried to automate Writer so I don't know how big the integration gap is or how version dependent Writer files are. I've never tried automating OpenOffice either, but I know that there's the pyUno bridge for the purpose. OpenOffice automation is done in Java (yuck) but I think pyUno lets you write python code to do it. Be my guest! :) Paul Like you said there are several solutions out on the web. The ones I found all had java as the base programming language (BIRT, jReport, openOffice). I took a good look at automating openoffice. In fact I found a few examples of automating openOffice written in Python that I played with. But I have to say automating openoffice might have a few advantages but in general just a pain. Actually, not much different than coding for Word or Excel (in a general way). But really what are those advantages? The developer has access to Writer and Calc (and of course all the other openOffice tools). There are two ways to control openOffice the built-in scripting language (like VBA) and pyUNO. The first required I learn yet another language. So I ruled that out. The second worked but required that I learn enough of the feature set of openOffice to cause me to reconsider. I have coded for Word and Excel in the past. And my memories were that it was a PITA. And last - I had to have openOffice installed somewhere (openOffice will work a server). Believe it or not but some of my client don't want to let go of M$. But one big is openOffice can print to almost any printer and almost anywhere there is a connection. But let's assume that ReportDesigner and reportWriter are working as expected. Then all I have to learn is - Hmmm - Nothing! It uses all the Dabo stuff from the start. The biggest issue is reportWriter does not print - it only creates PDF files and of course no spreadsheets. However, the last statement turns out not to be exactly correct. Viewers and therefore printing are ubiquitous for PDF's. Acroread, kPDF, and many others are available free and normally installed. Turns out printing a PDF from python for Linux, Mac, and Windows is very easy. Take a look at win32print for you windows guys and cups for linux and Mac. So that just leaves spreadsheets. Currently we are using xlwt which is about the same amount of work to produce a spreadsheet as it was with Excel. And of course it will require something like openOffice or Excel to print or view. I haven't found a solution around this problem - but I hope too. Anyway, the above was my thinking and that's what we are using. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905181846.37333.jfabi...@yolo.com
[dabo-users] 2.6 still no joy.
FYI: I've been watching the wxPython list and it looks like python 2.6 and wxPython 2.8.10.1 are still not working - at least on Windows. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905182058.46973.jfabi...@yolo.com
Re: [dabo-users] Using several bizobjs on one form
On Saturday 16 May 2009 05:02:06 pm Miguel Lopes wrote: Please, do send the copy of the discussion. It will certainly be helpful to me. Txs I've sent it off-line. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905170718.09399.jfabi...@yolo.com
Re: [dabo-users] Using several bizobjs on one form
On Sunday 17 May 2009 04:23:07 am Miguel Lopes wrote: On Sun, May 17, 2009 at 5:15 AM, Ed Leafe e...@leafe.com wrote: On May 16, 2009, at 9:48 PM, Miguel Lopes wrote: . But if you have different bizobjs from the same table Ah, I think that this is the problem. A bizobj represents the business logic interface to a table, so while there may be more than one instance of a bizobj, there should not be more than one set of rules that govern a table. I understand what you mean and, given I don't know Dabo I'm probably wrong. But the bizobj also encapsulates relationships and this sparks the need for several bizobjs from the same table, or not? Let me give you an example: account.account_id = contact.account_id (1 Account, M Contact) opportunity.opportunity_id = contact.opportunity_id (1 Opportunity, M Contact) So contacts are assigned to Acounts, but they may also be assigned to Opportunities. I have two diferent pages listing all Accounts and All Opportunities both with a contacts tab. Since it's only possible to have one LinkField in a bizobj (it wouldn't make since anyother way), this means: class ContactAcctBizobj(dabo.biz.dBizobj): def afterInit(self): self.addFrom(contact) ... self.addField(contact_id) self.addField(account_id) self.DataSource = contact self.LinkField = account_id # LinkField is different self.KeyField = contact_id class ContactOpptyBizobj(dabo.biz.dBizobj): def afterInit(self): self.addFrom(contact) ... self.addField(contact_id) self.addField(opportunity_id) self.DataSource = contact self.LinkField = opportunity_id # LinkField is different self.KeyField = contact_id What am I missing here? Does Bizobj.addChild work for bizobjs that have not been added to a Form? Sure. Bizobjs don't know anything about UI objects. Great. Miguel I have played with this issue in the recent past ( a few months ago). account.account_id = contact.account_id (1 Account, M Contact) opportunity.opportunity_id = contact.opportunity_id (1 Opportunity, M Contact) In the visual Fox Pro world setting up that relation is easy. VFP has 'use again'. Where I can reuse a table with a different alias. I have attempted to do the same with Dabo without success. I don't say it can't be done (because others have reported success) I just say I was unsuccessful. I have defined a class for a bizobj and I called it 'Contact' class Contact(dabo.biz.dBizobj): def afterInit(self): self.DataSource = 'public.contact' self.KeyField = 'pkid' self.addField = 'pkid' self.addField = 'name' self.addField = 'fk_account' self.addField = 'fk_opportunity' In the MainForm Class I have tried: def CreateBizobjs(self): self.acct_Contact = Contact(self.connection) self.acct_Contact.LinkField= 'fk_account' self.acct_Contact.ParentLinkField = 'pkid' self.opp_Contact = Contact(self.connection) self.oop_Contact.LinkField= 'fk_opportunity' self.oop_Contact.ParentLinkField = 'pkid' The above code does not work for me. But I think it should. I have two instances of the same table and each instances has different links. I have tried changing the string of the DataSource (used the addFrom ='public.contact') for each of the instances. And that does not work. In the end I used a view to make it work. I was able to do so because the program only required a read only table. As of 8.3 postgres I can update views in a much simplier manner. So it may be a moot issue. But still I think it should work. Of course you could have designed the tables in a different manner. I'm sure that's what Ed will say. There are several ways to get that done. All depend on your needs. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905170713.15943.jfabi...@yolo.com
Re: [dabo-users] Using several bizobjs on one form
On Saturday 16 May 2009 10:55:06 am Miguel Lopes wrote: Hi, I have MainForm with a dPageFrameNoTabs that holds several dPages (accounts, opportunities, servicecases). My goal is to have a single location to navigate, new, delete, save, and whatever actions are common to all the pages in the MainForm Toolbar (a VCR control). I think this is a design issue that should be quite common for data intensive applications that are not following the MDI or multi form interfaces - I mean those that try to keep all in one form, and open forms just for specific taks (typically in a modal fashion). I searched the lists for quite a while and am surprised to have very little regarding this design challenge. So I came decided to post this. I came up with the following approach, but am uncertain. Is there a Dabo way to accomplish this? I wonder what is your approach? * Use different Bizobjs depending on the selected dPage. In order to do this every time a dPage changes (in the dPageFrameNoTabs), self.dataSourceParameter is updated to the relevant bizobj. You can have as many bizobjs as required. The very first defined bizobj is the PrimaryBizobj by default. Are each of the bizobjs independent of each other? * I'm know the MainForm is aware of its primaryBizobj, so the dataSourceParameter as a parameter in every VCR call to MainForm methods. I do this because the VCR has no way of knowing if dPage has changed: I think there maybe lots of ways to handle this. I think I would create a method for next() and test for the active page. Something like: def next(self,evt): if thisPage_IsActive: self.thisPageBizobj.next() ## write code to move to the next record in the bizobj - if required OR you could just set a Form property as you enter the dPage in the next() that would set the name of the bizobj. def next(self,evt): eval(self.varName.next()) # on the new MainForm method called by the VCR button def new(self, evt): self.super(dataSource=self.dataSourceParameter) Did you mean 'new'? Normally, VCR's buttons are not associated with the new(). Normally they are next,last,first,prior. * Keep separate bizObjs groups for each dPage, for example: For the AccountMainPage: AccountBizobj, with children named: AcctOpptiesBizobj, AcctContactsBizobj For the OpptyMainPage: OpptyBizobj, with children named: OpptyContactsBizobj, OpptyServCasesBizobj If the tabs (dPage) are truely independent then that sounds great. But normally there is a master table of some sort. Maybe it is the customer table. Then you might have tabs with names like 'Customer', 'Sales History', 'Contacts', 'On order', 'Notes'. Then I have 'Customer' as the primarybiz, children would be 'Sales', 'Contacts', etc.. If you have a many to many issue - let me know and I'll send you a copy of a recent discussion one a way to handle the problem. Of course all these bizobjs will live under the MainForm, the AccountBizobj is the primaryBizobj. I doubt the above would be much help if the tabs are independent. I see the following issues/doubts: * Maybe to may Bizobjs under the form may slow things due to lots of data loading. I have not seen to much of an issue with the number of bizobjs the form requires. Retrieving lots of data might be but the number does not seems to effect very much. * MainForm.dataSourceParameter is used in a way it's not designed to. But I don't see a problem there, do you? I've never used the dataSourceParameter. Like I asked, does this make sense. What's your opinion/ approach? Miguel -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905161427.40953.jfabi...@yolo.com
[dabo-users] intermediary table as parent
In a many to many relationship there is often a third table -intermediary table. Normally, I link based on two fields. But bizobj.LinkField only allows one string or one field. It would be nice if the bizobj.LinkField could accept a tuple with multi fields and have the where cause work correctly for the child. So it would be nice to have a bizobj.LinkField that accepted more than just one field. Of course there maybe a different way to handle the situation of needing a where clause that requires to fields. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905140905.11729.jfabi...@yolo.com
Re: [dabo-users] intermediary table as parent
On Thursday 14 May 2009 09:29:44 am Paul McNett wrote: create table people (id integer primary key, name char); create table categories (id integer primary key, name char); create table peoplecat (id integer primary key, person_id, category_id); The peoplecat table is the intermediary table. So I make a bizobj on the peoplecat table, with SQL like: select peoplecat.id as id, peoplecat.person_id as person_id, peoplecat.category_id as category_id, people.name as person_name, categories.name as category_name left join people on people.id = peoplecat.person_id left join categories on categories.id = peoplecat.category_id group by peoplecat.id I then make 2 subclasses, PeopleForCategory and CategoriesForPerson. PeopleForCategory has a LinkField of category_id, and CategoriesForPerson has a LinkField of person_id. Your People bizobj adds CategoriesForPerson as a child, and your Categories bizobj adds PeopleForCategory as a child. Trying to get my head around this. How do I create the subclasses??? class PeopleForCategory(Bizobj_peoplecat,dabo.biz.dBizobj) def afterInit(self): self.LinkField = 'category_id' -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905141039.09545.jfabi...@yolo.com
Re: [dabo-users] intermediary table as parent
On Thursday 14 May 2009 10:48:14 am Paul McNett wrote: johnf wrote: On Thursday 14 May 2009 09:29:44 am Paul McNett wrote: create table people (id integer primary key, name char); create table categories (id integer primary key, name char); create table peoplecat (id integer primary key, person_id, category_id); The peoplecat table is the intermediary table. So I make a bizobj on the peoplecat table, with SQL like: select peoplecat.id as id, peoplecat.person_id as person_id, peoplecat.category_id as category_id, people.name as person_name, categories.name as category_name left join people on people.id = peoplecat.person_id left join categories on categories.id = peoplecat.category_id group by peoplecat.id I then make 2 subclasses, PeopleForCategory and CategoriesForPerson. PeopleForCategory has a LinkField of category_id, and CategoriesForPerson has a LinkField of person_id. Your People bizobj adds CategoriesForPerson as a child, and your Categories bizobj adds PeopleForCategory as a child. Trying to get my head around this. How do I create the subclasses??? Just like any other subclass. class PeopleForCategory(Bizobj_peoplecat,dabo.biz.dBizobj) def afterInit(self): self.LinkField = 'category_id' No. class BizPeopleCat(dabo.biz.dBizobj): def initProperties(self): ... create the sql, set the common props, etc. class PeopleForCategory(BizPeopleCat): def initProperties(self): self.super() # get the common props initialized self.LinkField = 'category_id' HTH Paul OK I understand that part. People bizobj adds BizPeopleCat as a child right? This really needs a wiki entry. I would do it but I doubt I completely understand it. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905141056.47437.jfabi...@yolo.com
[dabo-users] date rollover - wrong century
I have a dDateTextBox that holds birthdays. My problem is the program is saving the date incorrectly. I set the date to '12/12/1970' and I save '12/12/2070' to database. Which is one century wrong. What am I doing wrong??? How do I fix this? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905131126.03121.jfabi...@yolo.com
Re: [dabo-users] date rollover - wrong century
On Wednesday 13 May 2009 11:26:03 am johnf wrote: I have a dDateTextBox that holds birthdays. My problem is the program is saving the date incorrectly. I set the date to '12/12/1970' and I save '12/12/2070' to database. Which is one century wrong. What am I doing wrong??? How do I fix this? In dDateTextBox.py def setDate(self, dt): Sets the Value to the passed date if this is holding a date value, or sets the date portion of the Value if it is a datetime. val = self.Value if isinstance(val, datetime.datetime): self.Value = val.replace(year=dt.year, month=dt.month, day=dt.day) else: self.Value = dt print self.Value self.flushValue() In the above method dt = datetime.date(1989,5,9) and self.Value prints datetime.date(2089,5,9) -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905131158.46407.jfabi...@yolo.com
Re: [dabo-users] date rollover - wrong century
On Wednesday 13 May 2009 12:14:19 pm Ed Leafe wrote: On May 13, 2009, at 1:26 PM, johnf wrote: I have a dDateTextBox that holds birthdays. My problem is the program is saving the date incorrectly. I set the date to '12/12/1970' and I save '12/12/2070' to database. Which is one century wrong. I'm not seeing this at all. I did the following: import datetime tx = dabo.ui.dDateTextBox(self) dt = datetime.date(1989, 5, 9) tx.setDate(dt) print tx.Value - 1989-05-09 Anyone else get John's results with this script? -- Ed Leafe I think I have traced this down to the dates.py and the format I am using. I am using the following dabo.settings.dateFormat =American In dates.py I see the year change ~line 126 if m is not None: groups = m.groupdict() if not groups.has_key(year): curYear = datetime.date.today().year if groups.has_key(shortyear): groups[year] = int(%s%s % (str(curYear)[:2], groups[shortyear])) else: groups[year] = curYear try: ret = datetime.date(int(groups[year]), int(groups[month]), int(groups[day])) except ValueError: # Could be that the day was out of range for the particular month # (Sept. only has 30 days but the regex will allow 31, etc.) pass if ret is not None: break I think this has something to do with how dates.py seeing my groups. groups {'shortyear': u'79', 'day': u'08', 'month': u'05'} Where does Dabo account for the rollover? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905131230.15526.jfabi...@yolo.com
Re: [dabo-users] date rollover - wrong century
On Wednesday 13 May 2009 12:54:38 pm Ed Leafe wrote: On May 13, 2009, at 2:30 PM, johnf wrote: Where does Dabo account for the rollover? I should also mention that there isn't any other place where that attribute is used, so I imagine that it was leftover from the old dDateTextBox code. So any rollover is done in the Python classes. -- Ed Leafe I'm going create a ticket on the rollover as a future feature. Paul was able to confirm the following: using the format dabo.settings.dateFormat =%m/%d/%y will not allow the user to provide the century as in 1970 it becomes 2070 That dabo.settings.dateFormat was defined twice (fixed). dabo.settings.dateFormat =%m/%d/%Y does work correctly. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905131319.51353.jfabi...@yolo.com
Re: [dabo-users] Using dDropdownList for parent record s, not for lookup
On Monday 11 May 2009 03:59:20 am Sibylle Koczian wrote: Ed Leafe schrieb: On May 10, 2009, at 4:09 AM, Sibylle Koczian wrote: I don't think the way to populate the list shown in the wiki is the right way for this case (or is it?). I tried simply to create the dropdown list like this: dl = dabo.ui.dDropdownList(pn, DataSource=rubrik, DataField=rub_name) dl.ValueMode = String The wiki example is primarily designed for foreign key lookups, not for cases like this where you are storing the data directly in the table. That's what I thought. One requirement of list controls that we inherit from wxPython is that the value must be an item in the list. When you set DataSource and DataField, it tries to set the value of the control, but you haven't populated the Choices yet, so you get the error you reported. So the Keys and Choices aren't populated automagically by setting DataSource and DataField, right? Thinking this over: that wouldn't work for the lookup case, I think. The best way to handle this is to set the DataSource and DataField *after* you have populated the list. So remove those from the constructor code. You can include ValueMode in the constructor; you can also include Choices if you've already determined them. So the optimal code would be: chc = some method to get available choices dl = dabo.ui.dDropdownList(pn, Choices=chc, ValueMode=String) dl.DataSource = rubrik dl.DataField = rub_name I tried this, and now the dDropdownList is filled correctly, I get no error messages - but the parent-child relation doesn't seem to work: the grid for the child records always shows the records belonging to the first parent record. I didn't see anything in the code that looked wrong so I would start doing some debugging. I have a guess that the problem is the dropdown is changing but the record of the 'rubrik' is not moving. So you can prove it. First open a dShell (contrl-d). Check to see if the value of the dropdown is changing. Most likely it is. Check CurrentSQL for 'dinge' and make sure that the where is changing or is not changing. At the same time check the 'rubrik' dataset and see if it's changing. If the above proves correct then I would write a little code that fired as a result of the dropdown that will set the where clause of either of the two tables. Then requery() -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905110645.52587.jfabi...@yolo.com
Re: [dabo-users] Using dDropdownList for parent record s, not for lookup
On Monday 11 May 2009 07:48:56 am Sibylle Koczian wrote: johnf schrieb: On Monday 11 May 2009 03:59:20 am Sibylle Koczian wrote: I tried this, and now the dDropdownList is filled correctly, I get no error messages - but the parent-child relation doesn't seem to work: the grid for the child records always shows the records belonging to the first parent record. I didn't see anything in the code that looked wrong so I would start doing some debugging. I have a guess that the problem is the dropdown is changing but the record of the 'rubrik' is not moving. So you can prove it. It's even worse: the record of the rubrik bizobj not only doesn't move, it gets the key of the record just shown in the dropdown. And that key is the primary key of the table. Wonderful. Luckily I haven't done anything about saving yet. It's clear I made quite wrong assumptions about dDropdownList (and about the other list controls?). I thought moving through the choices list would move through the records of the dataset and show the content of the current DataField, but instead it seems to put the current value _into_ the DataField of the current record, which doesn't move. Right? First open a dShell (contrl-d). Many thanks for that advice, I hadn't discovered the dShell yet! Thank you, Sibylle In my code I do something similar that is I use a dropdown to provide the filter/where clause info. But I bind the 'Hit' event to a method. In the method I set the whereclause of the table I need filtered - then requery the table. It works well. topiclist.bindEvent(dabo.dEvents.Hit, self.get_essess1) def get_essses1(self,evt): self.essession.setWhereClause(topic = %s % self.Topic1ID.Value) self.essession.requery() With my solution do NOT provide a DataSource and DataField for the dropdown. Get use the value from the selection and set the starting value of the dropdown. Also you will need a way save the value into the table. There are plenty of ways to go - but you get the general idea. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905110807.47147.jfabi...@yolo.com
Re: [dabo-users] Using dDropdownList for parent records, not for lookup
On Sunday 10 May 2009 02:09:28 am Sibylle Koczian wrote: Hello, I've got a table for categories and another for items in those categories. Now I want to create a very simple form: a dropdown list for the category names and a grid showing the most important fields of the items table. The grid should always show the records belonging to the category chosen in the dropdown list. So I use the bizobj for the categories table as parent and the bizobj for the items table as child bizobj. I don't think the way to populate the list shown in the wiki is the right way for this case (or is it?). I tried simply to create the dropdown list like this: dl = dabo.ui.dDropdownList(pn, DataSource=rubrik, DataField=rub_name) dl.ValueMode = String But that doesn't work. When I open the application, I get this: Traceback (most recent call last): raise ValueError(_(String must be present in the choices.)) ValueError: String must be present in the choices. So how to do this? Thanks for pushes in the right direction, Sibylle A dropdown is the simplest list Dabo has. It requires at least one list (but in your case I think you will provide two list). When I say 'list' I mean a python list. The first list is Choices. It will contain the strings (maybe the description string in this case) from categories table. If you use a second list (Keys) it will contain the unique number associated with the choice string. There are several ways to create the list. If the table is small. You can do something like: def categoriesChoices(self): self.categories.requery() ##the bizobj for categories categoriesDS = self.categories.getDataSet() categories_Choices=['None'] categoriesKeys=[0] for row in categoriesDS: descript=row['description'].strip() categories_Choices.append(county) categoriesKeys.append(row['pkid']) return categories_Choices,categoriesKeys In the above list I have setup two values in advance None and 0 (number 0). If Dabo returns a Null (python None) it will convert the value to 'None'. So this is to avoid the error of 'None' not being in the list. Next you use your list(s) method available_choices, available_keys= self.categoriesChoices() Now create the control on your form. dl = dabo.ui.dDropdownList(pn, Choices=available_choices, Keys=available_keys,DataSource=rubrik, DataField=fk_categories,ValueMode ='key') In this case I'm using ValueMode ='key'. Because I like to use foreign keys (FK) to find my data. So my tables would look similar to: table categories pkid (auto-increment) description - a string table rubrik ## will have at least pkid (auto-increment) fk_categories ## this is the PK from categories. The dropdown will display the description field and return the key (or FK) for each selection. If you still want to save the string value just change the ValueMode. BTW all the list controls work in a similar way. It's best to check the test and demo code for the controls to see how they work. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905100715.49969.jfabi...@yolo.com
Re: [dabo-users] Using dDropdownList for parent records, not for lookup
On Sunday 10 May 2009 07:15:49 am johnf wrote: On Sunday 10 May 2009 02:09:28 am Sibylle Koczian wrote: Hello, I've got a table for categories and another for items in those categories. Now I want to create a very simple form: a dropdown list for the category names and a grid showing the most important fields of the items table. The grid should always show the records belonging to the category chosen in the dropdown list. So I use the bizobj for the categories table as parent and the bizobj for the items table as child bizobj. I don't think the way to populate the list shown in the wiki is the right way for this case (or is it?). I tried simply to create the dropdown list like this: dl = dabo.ui.dDropdownList(pn, DataSource=rubrik, DataField=rub_name) dl.ValueMode = String But that doesn't work. When I open the application, I get this: Traceback (most recent call last): raise ValueError(_(String must be present in the choices.)) ValueError: String must be present in the choices. So how to do this? Thanks for pushes in the right direction, Sibylle A dropdown is the simplest list Dabo has. It requires at least one list (but in your case I think you will provide two list). When I say 'list' I mean a python list. The first list is Choices. It will contain the strings (maybe the description string in this case) from categories table. If you use a second list (Keys) it will contain the unique number associated with the choice string. There are several ways to create the list. If the table is small. You can do something like: def categoriesChoices(self): self.categories.requery() ##the bizobj for categories categoriesDS = self.categories.getDataSet() categories_Choices=['None'] categoriesKeys=[0] for row in categoriesDS: descript=row['description'].strip() categories_Choices.append(county) categoriesKeys.append(row['pkid']) return categories_Choices,categoriesKeys In the above list I have setup two values in advance None and 0 (number 0). If Dabo returns a Null (python None) it will convert the value to 'None'. So this is to avoid the error of 'None' not being in the list. Next you use your list(s) method available_choices, available_keys= self.categoriesChoices() Now create the control on your form. dl = dabo.ui.dDropdownList(pn, Choices=available_choices, Keys=available_keys,DataSource=rubrik, DataField=fk_categories,ValueMode ='key') In this case I'm using ValueMode ='key'. Because I like to use foreign keys (FK) to find my data. So my tables would look similar to: table categories pkid (auto-increment) description - a string table rubrik ## will have at least pkid (auto-increment) fk_categories ## this is the PK from categories. The dropdown will display the description field and return the key (or FK) for each selection. If you still want to save the string value just change the ValueMode. BTW all the list controls work in a similar way. It's best to check the test and demo code for the controls to see how they work. oops should be descript=row['description'].strip() categories_Choices.append(descript) -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905100720.20835.jfabi...@yolo.com
Re: [dabo-users] Vista/7 dPage Visibility problem
On Thursday 07 May 2009 01:07:56 pm Paul McNett wrote: alta...@ceid.upatras.gr wrote: I have encountered a problem running a dabo application in windows 7 (but I suppose it would be the same in Vista). I have in my dForm's (my main form) afterInitAll(), this line: self.ListPage.Visible = False which works in Linux but not in windows. ListPage is the RegID of a dPage in a dPageFrame I have. I had this property printed, and the value is indeed False, but the dPage is still visible. Anything I can do? It's actually pretty important for this dPage to not be visible, as I set it to Visible i the user is the admin, so it's a security issue. Also, if you have amy other suggestions for me to prevent the user from accessing that dPage if he's not authorized to do so, please tell me. In my app, I don't instantiate things if they aren't available for whatever reason. Actually, there are places where I set the visibility, usually of the controlling sizer. I guess I need to purchase some newer versions of Windows to test on, too. Frustrating... Paul Larry is using Vista. We use the hide/visual property of tabs and we also use dabo.ui.dPageFrameNoTabs to hide pages. I hope Larry read this - I'll give him a heads up about the post. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905071340.35381.jfabi...@yolo.com
Re: [dabo-users] Vista/7 dPage Visibility problem
On Thursday 07 May 2009 01:40:35 pm johnf wrote: On Thursday 07 May 2009 01:07:56 pm Paul McNett wrote: alta...@ceid.upatras.gr wrote: I have encountered a problem running a dabo application in windows 7 (but I suppose it would be the same in Vista). I have in my dForm's (my main form) afterInitAll(), this line: self.ListPage.Visible = False which works in Linux but not in windows. ListPage is the RegID of a dPage in a dPageFrame I have. I had this property printed, and the value is indeed False, but the dPage is still visible. Anything I can do? It's actually pretty important for this dPage to not be visible, as I set it to Visible i the user is the admin, so it's a security issue. Also, if you have amy other suggestions for me to prevent the user from accessing that dPage if he's not authorized to do so, please tell me. In my app, I don't instantiate things if they aren't available for whatever reason. Actually, there are places where I set the visibility, usually of the controlling sizer. I guess I need to purchase some newer versions of Windows to test on, too. Frustrating... Paul Larry is using Vista. We use the hide/visual property of tabs and we also use dabo.ui.dPageFrameNoTabs to hide pages. I hope Larry read this - I'll give him a heads up about the post. Looking at Larry's code I noticed that he is using DynamicVisible DynamicSelectedPageNumber and update() I wonder if you issued an self.update() after setting the property? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905071347.00866.jfabi...@yolo.com
Re: [dabo-users] Vista/7 dPage Visibility problem
On Thursday 07 May 2009 03:39:37 pm alta...@ceid.upatras.gr wrote: On Thursday 07 May 2009 01:40:35 pm johnf wrote: On Thursday 07 May 2009 01:07:56 pm Paul McNett wrote: altanis (at) ceid D.O.T upatras.gr wrote: I have encountered a problem running a dabo application in windows 7 (but I suppose it would be the same in Vista). I have in my dForm's (my main form) afterInitAll(), this line: self.ListPage.Visible = False which works in Linux but not in windows. ListPage is the RegID of a dPage in a dPageFrame I have. I had this property printed, and the value is indeed False, but the dPage is still visible. Anything I can do? It's actually pretty important for this dPage to not be visible, as I set it to Visible i the user is the admin, so it's a security issue. Also, if you have amy other suggestions for me to prevent the user from accessing that dPage if he's not authorized to do so, please tell me. In my app, I don't instantiate things if they aren't available for whatever reason. Actually, there are places where I set the visibility, usually of the controlling sizer. I guess I need to purchase some newer versions of Windows to test on, too. Frustrating... Paul Larry is using Vista. We use the hide/visual property of tabs and we also use dabo.ui.dPageFrameNoTabs to hide pages. I hope Larry read this - I'll give him a heads up about the post. Looking at Larry's code I noticed that he is using DynamicVisible DynamicSelectedPageNumber and update() I wonder if you issued an self.update() after setting the property? -- John Fabiani I don't use the Dynamic version of Visible. DynamicVisible is set to None (I checked). The API states that when DynamicVisible is set to None, Visible can be explicitly set. As for not instantiating the object, I am using a cdxml file, so I don't see how I can not instantiate the dPage. Alexander I don't don't use cdxml forms (most of the time). I hand code my files. But I wonder if you could use something like below self.Form.PageFrameName.Pages[pagenum].bindEvent(dabo.dEvents.PageEnter, self.Form.someTest) def someTest(self,evt): lock the screen check to see if the user is allowed access if not - blank tab dPanel (or exchange it with a blank one). self.update() unlock screen There's got to be a way to do this from a cdxml. There is very little that can't be done with a cdxml. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905071615.10613.jfabi...@yolo.com
Re: [dabo-users] Could view but couldn't insert in AppWizard built app
On Tuesday 05 May 2009 01:07:48 pm Paul McNett wrote: Steve Litt wrote: Hi all, How do I narrow down this problem? My AppWizard generated program can view the data but gets a traceback when I try to write it. I used AppWizard to build a hello word from Postgres database test with single table people consisting of an autoincrement called person_id, and text fields fname, lname and job. The generated app was able to view the data, but when I tried to add, it failed with the following trace: [snip] File /usr/lib/python2.5/site-packages/Dabo-0.9.1-py2.5.egg/dabo/db/dCursorMix in.py, line 760, in genTempAutoPK pkVal = rec[kf] KeyError: '' Is there a primary key defined in the postgres table? If so, it appears that AppWizard didn't identify it as such when generating the app. Try going into the generated bizobj and adding to initProperties(): self.KeyField = person_id self.AutoPopulatePK = True Paul I always get confused as to the meaning of AuotPopulatePK. If the PO has person_id defined as data type serial (auto-increment) Dabo should NOT supply a PK number. He should also set bizobj.NonUpdateFields=['person_id'] -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905051313.26054.jfabi...@yolo.com
Re: [dabo-users] Could view but couldn't insert in AppWizard built app
On Tuesday 05 May 2009 01:18:06 pm Paul McNett wrote: If the PO has person_id defined as data type serial (auto-increment) Dabo should NOT supply a PK number. What if it is a serial type but not the PK? He should also set bizobj.NonUpdateFields=['person_id'] Is that still necessary? I know it was for a while there.. then it still needs NonUpdateFields=['person_id'] Allowing Dabo to populate the field would be silly - why have the sequence associated with the field if you wanted dabo to populate. That's what a data type of serial denotes (auto-increment). Most developers would also require a constraint on the field and that might cause an error at some point. But like Ed has said several times - (I paraphase) Let the developer do silly things. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905051533.55729.jfabi...@yolo.com
Re: [dabo-users] Could view but couldn't insert in AppWizard built app
On Tuesday 05 May 2009 04:24:23 pm Ed Leafe wrote: Um, John... if the field is marked as AutoPopulatePK, it is excluded from updates. If you've found otherwise, please file an issue in Trac. I have several apps in which the database creates the PK, and they're all working fine. Maybe I mis-understood Paul's question. I thought he said NOT a pk but still had a sequence. Of course that would be para for the course lately. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905051648.35229.jfabi...@yolo.com
Re: [dabo-users] VirtualFields error
On Sunday 03 May 2009 06:14:29 pm alta...@ceid.upatras.gr wrote: I am trying to use a VirtualField, but I get a dabo.dException.FieldNotFoundException. This is the code for my BizObj's afterInit(): def afterInit(self): self.DataSource = stoixeiapaidion self.KeyField = kleidi self.addField(stoixeiapaidion.kleidi) ... self.addField(stoixeiapaidion.xaraktirismos) self.addFrom(stoixeiapaidion) self.NewChildOnNew = True self.VirtualFields = {TextXar:self.getTextXar} and I also define this method below: def getTextXar(self): I set the DataField property of a grid column in my application to TextXar, but I always get this when the column is visible: dabo.dException.FieldNotFoundException: Field 'TextXar' does not exist in the data set and the column is empty. You did not show the complete bizobj (you used ...) but you should have self.addField(TextXar) -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905031848.02470.jfabi...@yolo.com
Re: [dabo-users] VirtualFields error
On Sunday 03 May 2009 07:26:21 pm Ed Leafe wrote: On May 3, 2009, at 8:48 PM, johnf wrote: You did not show the complete bizobj (you used ...) but you should have self.addField(TextXar) That is not correct. If you call addField() on a column that doesn't exist in the table, you will get SQL errors. Virtual fields are calculated as needed locally. -- Ed Leafe I stand corrected. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200905032015.18402.jfabi...@yolo.com
Re: [dabo-users] Report Designer international characters problem
On Thursday 30 April 2009 06:04:36 pm alta...@ceid.upatras.gr wrote: Paul McNett wrote: I'll get an example working with the code points you gave me, and then post the code. Let me know if this helps: http://trac.dabodev.com/wiki/CustomFontsInReportWriter Paul I tried to run test_tty.py, but I got this output: from: can't read /var/mail/reportlab.pdfbase from: can't read /var/mail/reportlab.pdfbase.ttfonts from: can't read /var/mail/reportlab.lib.fonts from: can't read /var/mail/dabo.dReportWriter from: can't read /var/mail/dabo.lib.reportUtils ./test_ttf.py: line 10: reportlab.rl_config.warnOnMissingFontGlyphs: command not found ./test_ttf.py: line 11: syntax error near unexpected token `/usr/share/fonts/truetype/ttf-bitstream-vera' ./test_ttf.py: line 11: `reportlab.rl_config.TTFSearchPath.append(/usr/share/fonts/truetype/ttf-bi tstream-vera)' :( Alexander First read up on 'path' with respect to python. That will cover the first of part of the error messages. I think you are on windows (earlier posting suggested you were using webupdate normal for the window guys). And I wonder if the /usr/share/fonts/truetype/ttf-bitstream-vera would work even if you got the modules imported. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904301831.16260.jfabi...@yolo.com
Re: [dabo-users] Report Designer international characters problem
On Thursday 30 April 2009 06:43:32 pm alta...@ceid.upatras.gr wrote: On Thursday 30 April 2009 06:04:36 pm altanis at ceid D.O.T upatras.gr wrote: Paul McNett wrote: I'll get an example working with the code points you gave me, and then post the code. Let me know if this helps: http://trac.dabodev.com/wiki/CustomFontsInReportWriter Paul I tried to run test_tty.py, but I got this output: from: can't read /var/mail/reportlab.pdfbase from: can't read /var/mail/reportlab.pdfbase.ttfonts from: can't read /var/mail/reportlab.lib.fonts from: can't read /var/mail/dabo.dReportWriter from: can't read /var/mail/dabo.lib.reportUtils ./test_ttf.py: line 10: reportlab.rl_config.warnOnMissingFontGlyphs: command not found ./test_ttf.py: line 11: syntax error near unexpected token `/usr/share/fonts/truetype/ttf-bitstream-vera' ./test_ttf.py: line 11: `reportlab.rl_config.TTFSearchPath.append(/usr/share/fonts/truetype/tt f-bi tstream-vera)' :( Alexander First read up on 'path' with respect to python. That will cover the first of part of the error messages. I am sorry I didn't quite understand this. I think you are on windows (earlier posting suggested you were using webupdate normal for the window guys). And I wonder if the /usr/share/fonts/truetype/ttf-bitstream-vera would work even if you got the modules imported. I am on linux, and I checked, the fonts exist at these locations, so that's not a problem. Alexander ___ Post Messages to: Dabo-users@leafe.com 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/40638.94.64.255.1.1241142212.squir...@webma il.ceid.upatras.gr OK on Linux (what distro would be nice) First open a terminal and start python what's the version of python? Should be 2.4 or 2.5 next try to import reportLab by typing import reportlab I think you will get an error - but maybe not. Let know the results. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904301855.47953.jfabi...@yolo.com
Re: [dabo-users] dDateTextBox: date not changed, if popup calendar is used
On Wednesday 29 April 2009 04:48:09 am Sibylle Koczian wrote: Hello, in my application I've got a dDateTextBox connected to a data field which is NULL when the application starts and which is then filled in, usually with a date some days past. This works correctly (the right day gets into the database table), if I enter the date directly, not using the shortcuts. It works correctly if I enter 'T' and then '-' as often as necessary. But if I enter 'C' to open the popup calendar and choose the day there, then I get the chosen date into the dDateTextBox, but the current date into the database table. Database is Firebird, Dabo version: Platform: GTK Python Version: 2.6 on linux2 Dabo Version: Version 0.9.1; Revision 5191M UI Version: 2.8.9.2 on wxGTK (gtk2) Same thing on windows. What sort of information should I add? Should I try the same with a SQLite database? Greetings, Sibylle What happens if you double click on the control? Does the calendar pop-up? And if you select a date is that date stored in the DB? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904290650.39698.jfabi...@yolo.com
Re: [dabo-users] dDateTextBox: date not changed, i f popup calendar is used
On Wednesday 29 April 2009 06:58:32 am Sibylle Koczian wrote: python2.6 Dabo does not currently supporting 2.6. But I'm not sure this is only a 2.6 problem. I'm noticing that after changing the dDateBox control to any new date the Bizobj.IsChange() still returns 'False'. Therefore, the data is not updated with the new date. I'm using python 2.5.2 wxPython 2.8.9.1 openSUSE 10.3 latest svn -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904290709.20392.jfabi...@yolo.com
Re: [dabo-users] Disabling the close window button
On Wednesday 29 April 2009 09:08:52 am Paul McNett wrote: Ed Leafe wrote: On Apr 29, 2009, at 10:59 AM, lalo...@charter.net lalo...@charter.net wrote: How does one do this? I think that this should be the default behaviour for dabo modal dialogs, or at least a hook be in place to toggle it on or off. Have you tried passing ShowCloseButton=False to the form constructor? I also think it should default to False. Dialogs should not be resizable, closable, maximizable, or minimizable, nor should they appear in the task bar by default. Does everyone agree? Larry can you make a ticket? Paul When adding controls to the dialog it does not always size correctly to fit the controls. I have used AutoSize, etc.. none work complete right. Therefore, resizable is needed IMO. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904290926.51410.jfabi...@yolo.com
Re: [dabo-users] What happens after self.Form.new()
On Wednesday 22 April 2009 12:31:57 pm freek verstringe wrote: Hmm, actually I was trying to prefill with the last defined in database and then adding 1 to the id... is this an auto-incremment type field? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904221235.16235.jfabi...@yolo.com
Re: [dabo-users] What happens after self.Form.new()
On Wednesday 22 April 2009 01:16:39 pm freek verstringe wrote: I understand your concern about the adding. However, one of the fields of the child maps to product_id, so I need it available right away. Should I save it first then? Freagell. Paul McNett schreef: freek verstringe wrote: Hmm, actually I was trying to prefill with the last defined in database and then adding 1 to the id... Adding 1 to the id really needs to happen at the db layer, such as by using an auto_increment field, as some other person could be running your app, and also adding 1 to the last id, and then both you and that other person have assigned the same id to different records! For primary keys that are not auto-increment, you could use dabo.lib.getRandomUUID(), which is guaranteed to be unique every single time, but again you'd want to do that in the biz layer, not in the ui layer, using DefaultValues, like: def initProperties(self): self.DefaultValues[id] = dabo.lib.getRandomUUID For filling with info from the last record, that should happen in the biz layer too. Override afterNew(), and then: def afterNew(self): # get a list of field names, not including the pk: field_names = [f[0] for f in DataStructure where not f[2]] # iterate the field names and fill in the value from the prior row: for field_name in field_names: self.setFieldVal(field_name, self.getFieldVal(field_name, self.RowNumber-1)) # note that the above will fail if this new record is the only row in the # dataset. Paul [excessive quoting removed by server] ___ Post Messages to: Dabo-users@leafe.com 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/200904221327.01698.jfabi...@yolo.com
Re: [dabo-users] App startup time
On Tuesday 21 April 2009 09:36:05 am Paul McNett wrote: Asaf Greenberg wrote: Hi Is Dabo suitable for small utilities? Small GUI utilities, or command-line? It take about 12-15 seconds on my laptop to start the simplest Dabo application (created using the designer, each time i start it, i.e. OS cache didn't matter). How fast does this run (put it in a test.py file and run it): {{{ import time import dabo beg = time.time() dabo.ui.loadUI(wx) app = dabo.dApp() app.setup() def onActivate(evt): app.finish() app.MainForm = dabo.ui.dForm(OnActivate=onActivate) app.start() end = time.time() print Seconds to import dabo, instantiate a dApp, instantiate a dForm, and close the app:, end-beg }}} This will help determine if Python/Dabo is slow, or something in your form design or even in the cdxml conversion is the issue. Here's three runs on my Ubuntu 8.10 on not very impressive hardware: 3.82075691223 1.3194899559 1.3800508976 Is that normal? Or maybe Dabo is aimed only toward big applications? Dabo is aimed for big apps, yes. But, my big application loads and presents the first form to the user in less than 5 seconds. Or is there any way to reduce this time? Nate's suggestion of having an umbrella app loaded was pretty good. You could load it once and then select utilities from a menu or some sort of GUI. Paul My slowest form loads in 7 seconds on the avg. This is on three year old hardware (lots of ram 4 gb) using openSUSE. The same form runs much faster on windows XP around 4-5 second loads. With that said I have most everything available from Dabo on the form. Twenty nine bizobj's with lots of virtual fields, lots of joins, lots of parent child and grandchild relations, etc.. I have almost every control available from Dabo including the standard textboxes, date controls, check boxes, radio controls, dropdown boxes, tab pages, popup dialogs that contain Checklist. My point is the load time is reasonable. I have experimented with all sorts of ways to improve the load time without any real success. I then decided to test the load time against VFP. I did not have to write the VFP form from scratch because my current project requires that I emulate a VFP form in Dabo. IOW I created the Dabo form based on the VFP form. I found it was not that different. VFP for a similar form took around 4-5 seconds (on windows of course). In fact I discovered that I could get VFP to load even slower if I wasn't careful. I have thought about providing a splash screen while in the background loading of wx, and other modules required took place. But I haven't done anything about doing it. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904211003.06032.jfabi...@yolo.com
[dabo-users] None of my requery's work any longer.
I'll try to discover where the problem first started. But it had to be in the last couple of days. Traceback (most recent call last): File /home/johnf/downloads/dabo/dabo/ui/uiwx/dControlMixin.py, line 27, in _onWxHit self.raiseEvent(dEvents.Hit, evt, *args, **kwargs) File /home/johnf/downloads/dabo/dabo/ui/uiwx/dPemMixin.py, line 949, in raiseEvent super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs) File /home/johnf/downloads/dabo/dabo/lib/eventMixin.py, line 93, in raiseEvent bindingFunction(event) File /home/johnf/pyProject/pyProject/pespy/lookup.py, line 461, in OnOKBtn self.CallingForm.requery() File /home/johnf/downloads/dabo/dabo/ui/uiwx/dForm.py, line 482, in requery response = bizobj.requery() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 905, in requery self.requeryAllChildren() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 1433, in requeryAllChildren child.requery() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 871, in requery self.setChildLinkFilter() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 932, in setChildLinkFilter self._CurrentCursor.setChildFilter(linkField, val) File /home/johnf/downloads/dabo/dabo/db/dCursorMixin.py, line 2153, in setChildFilter alias = self.sqlManager._fromClause.split()[-1] IndexError: list index out of range -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904211134.53069.jfabi...@yolo.com
Re: [dabo-users] None of my requery's work any longer.
On Tuesday 21 April 2009 11:34:53 am johnf wrote: I'll try to discover where the problem first started. But it had to be in the last couple of days. Traceback (most recent call last): File /home/johnf/downloads/dabo/dabo/ui/uiwx/dControlMixin.py, line 27, in _onWxHit self.raiseEvent(dEvents.Hit, evt, *args, **kwargs) File /home/johnf/downloads/dabo/dabo/ui/uiwx/dPemMixin.py, line 949, in raiseEvent super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs) File /home/johnf/downloads/dabo/dabo/lib/eventMixin.py, line 93, in raiseEvent bindingFunction(event) File /home/johnf/pyProject/pyProject/pespy/lookup.py, line 461, in OnOKBtn self.CallingForm.requery() File /home/johnf/downloads/dabo/dabo/ui/uiwx/dForm.py, line 482, in requery response = bizobj.requery() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 905, in requery self.requeryAllChildren() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 1433, in requeryAllChildren child.requery() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 871, in requery self.setChildLinkFilter() File /home/johnf/downloads/dabo/dabo/biz/dBizobj.py, line 932, in setChildLinkFilter self._CurrentCursor.setChildFilter(linkField, val) File /home/johnf/downloads/dabo/dabo/db/dCursorMixin.py, line 2153, in setChildFilter alias = self.sqlManager._fromClause.split()[-1] IndexError: list index out of range restoring to 5179 all works. Looks like Ed's 5180 broke Dabo requery() -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904211141.23728.jfabi...@yolo.com
Re: [dabo-users] None of my requery's work any longer.
On Tuesday 21 April 2009 11:48:56 am Ed Leafe wrote: On Apr 21, 2009, at 1:41 PM, johnf wrote: File /home/johnf/downloads/dabo/dabo/db/dCursorMixin.py, line 2153, in setChildFilter alias = self.sqlManager._fromClause.split()[-1] IndexError: list index out of range restoring to 5179 all works. Looks like Ed's 5180 broke Dabo requery() What is your from clause? -- Ed All my bizobj are in a module and are similar to the following and this one is a child. def initProperties(self): self.DataSource = public.escourts def afterInit(self): self.addFrom = public.escourts self.addField(fk_esagency) self.addField(court_name) self.addField(address) self.addField(city) self.addField(state_1) self.addField(zip) self.addField(mainphone) self.addField(fax) self.addField(county) self.addField(notify_1) self.addField(note) self.addField(fk_county) self.addField(pkid) self.addField(inactive) self.KeyField = pkid self.NonUpdateFields=[pkid] self.DefaultValues={state_1:'CA','county':'None','fk_county':0} self.ParentLinkField =pkid self.LinkField = fk_esagency self.FillLinkFromParent = True self.addOrderBy('court_name') -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904211155.22948.jfabi...@yolo.com
Re: [dabo-users] Wat is the dabo way to do the following?
On Tuesday 21 April 2009 01:59:12 pm freek verstringe wrote: Probably I know too few about the dabo system. But it does not work. It generates an error concerning the addFrom field. I should probably connect first to the database with something like biz1 = MyBizobj(Connection) , however, I don't know how to make a connection. Furthermore a Connection object is already available inside the classdesigner, but this is somehow automagically generated from the cdxml file, so I cannot review this file. Furthermore putting this in the MyBizobj class file I think the biz1 variable is not globally accessible. Freagell Nate Lowrie schreef: On Tue, Apr 21, 2009 at 04:01, fv sdfsaer wrote: Is it somehow possible to distinguish two bizobjects with the same datasource? I can do self.Form.getBizobj('datasourcename') but there has to be another way. class MyBizobj(dabo.biz.dBizobj): def initProperties(self): self.DataSource = myTable #Code for rest goes here biz1 = MyBizobj() biz2 = MyBizobj() You don't have to attach them to the Form... Regards, Nate From within code created by ClassDesigner there will be a method of the Form createBizobjs(). In the method you should see something similar to publicagmiscBizobj = self.Application.biz.PublicagmiscBizobj(self.Connection) self.addBizobj(publicagmiscBizobj) Where self.Connection is the connection so in the method createBizobjs() do something like what follows: self.biz1=MyBizobj(self.Connection) self.biz2= Mybizobj(self.Connection) Notice that the there is NO code to add the bizobj's to the form. That works for what Nate was suggesting. How to make a connection: self.Application.addConnectFile(someConnectionFile.cnxml) self.Connection = self.Application.getConnectionByName(SomeConnectionName) If you are using ClassDesigner the above is done for you. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904211413.53475.jfabi...@yolo.com
Re: [dabo-users] Wat is the dabo way to do the following?
On Tuesday 21 April 2009 02:22:43 pm freek verstringe wrote: Can I somehow see the code that is generated. It could be usefull after all... Hmmm. I don't know. I can tell you that the code that is actually run is from a temp file that is created dynamicly and contains the code to display the controls - along with the methods you edit etc. when you run the code from ClassDesigner. Also have you tried the save as class etc... I think this is an Ed question. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904211431.58315.jfabi...@yolo.com
Re: [dabo-users] Wat is the dabo way to do the following?
On Sunday 19 April 2009 12:14:38 pm freek verstringe wrote: I have the following tables in database: products ___ product_id-primary key category_id price_id product_name price ___ product_id price_id-primary key price category ___ category_id-primary key category_name product_category_xref __ category_id product_id-primary key I want the following to display in a textbox product_id product_name price I want the following to display in a Listbox category_name When saving the following should happen: The product should be saved, the price corresponding to product_id too. This is not a problem. The problem is that I want also to change the category. The category_name is cross-referenced however. What I did so far is creating 4 bizobjects bizproduct bizprice bizcategory bizxref bizprice is child of bizproduct bizxref is child of bizproduct bizcategory is child of bizxref. Main problem is that when renaming the category_name, that all products in that category have a changed category_name (since they have the same category_id) Next problem is that I cannot make a working dropdownlist for the category (while a textbox with the same Field and Source is no problem). Anyone willing to help in these? Many thanks in advance, Freagel Below is a way to setup the dropdown - it's not the only way. Also make sure your bizobj's are available to the method. If you are using the ClassDesigner this should be straight forward. choice,key = self.Form.onCategory() cate_control= dabo.ui.dDropDownlist(self, RegID='categoryID',ValueMode='key', Choice=choice, Keys=key, DataSource='someTable', DataField='someField') ##add the control to your form self.Sizer.append(cate_control,1,'x') #under Mainform def onCategory(self,evt): #bizcategory self.bizcategory you should fix that. cat_choices= ['None] cat_keys = [0] for row in self.bizcategory.getDataSet(): cat_choices.append(row['category_name']) cat_keys.append(row['category_id']) return cat_choices, cat_keys -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904191824.42979.jfabi...@yolo.com
Re: [dabo-users] MYSQL-python-1.2.2.tar.gz
On Friday 17 April 2009 06:42:31 am Pete Theisen wrote: freek verstringe wrote: In my dabo install there was a colon (,) missing at the end of line 47 of the file dabo/ide/CxnEditor.py Changed the code to def createMenu(self): mb = self.MenuBar fm = mb.getMenu(base_file) fm.prepend(_(Open Connection File...), HotKey=Ctrl+O, OnHit=self.onOpenFile, ItemID=file_open, help=_(Open an existing connection file)) Hi Frank! I call that a comma (,), but whatever it is called, I added it per your example and saved the file. Still can't get dabo to come up on the screen as a program. Not sure I know how - clicking, double clicking? If your are on windows you have to setup the path in your environment to include the python path. Make sure you can type python at a command prompt and it starts. On Linux the python should be present and ready to run. A simple way to get started is to do the following: open a terminal (command prompt) change directory to ~dabo/ide and type python ClassDesigner.py. It should start. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904170731.08904.jfabi...@yolo.com
Re: [dabo-users] Executing stored procedure - how?
On Friday 17 April 2009 08:08:57 am Sibylle Koczian wrote: Additional question: the procedure I'm executing with the temporary cursor is executable, not selectable, so it doesn't return data. Would using the existing cursor wipe out the current dataset even in that case? At the moment I call requery() after executing the procedure, because I need the newly inserted data in my bizobj. No - a temp cursor is independent of the bizobj that created it. So newTempCursor = self.PrimaryBizObj.getTempCursor() is completely independent of the primary bizobj. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904170819.05395.jfabi...@yolo.com
Re: [dabo-users] Issue with multi dataset joins in a loop
On Thursday 16 April 2009 09:11:22 pm larry wrote: If you issue a multi dataset join execute command in a loop you get an error saying that the table already exists the second time thru the loop. I got around it by explicitly deleting the sqlite table at the end of the loop. Am I doing something wrong or should the dataset auto delete the table? For example... # reportDS = some dataset to report on #create a tempcursor tmpcursor=self.PrimaryBizobj.getTempCursor() #for each record in a bizobj for reportGroupRec in self.ReportGroupsBizobj.getDataSet(): #get distinct values from bizobj dataset groupidsDS=reportDS.execute('select distinct %s as groupid from dataset'%(reportGroupRec['cjoinfield'],)) #for each distinct value... for rec in groupidsDS: groupid = rec['groupid'] #get data from another table based on distinct value tmpcursor.execute('select pkid, nemailtype as demailtype, lusps_delivery as dusps, email from public.%s where pkid = %s'%(self.ReportGroupsBizobj.Record.cdeliveryinfotable, groupid)) #put data into a dataset ds1 = tmpcursor.getDataSet() #issue a select joining reportDS and ds1 datasets reportGroupDS=reportDS.execute('select dataset.*, demailtype, dusps from dataset join ds1 d on d.pkid=dataset.pkid', cursorDict={'ds1':ds1}) #dosomething with reportGroupDS #I had to add this to stop the error reportDS._cursor.execute('drop table ds1') Thanks, Larry Long Traceback... sqlite3.OperationalError: table ds1 already exists File c:\pyproject\pespy\RptForm1.py, line 452, in module app.start() File c:\dabo\dabo\dApp.py, line 377, in start self.uiApp.start(self) File c:\dabo\dabo\ui\uiwx\uiApp.py, line 333, in start self.MainLoop() File C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line 7964, in MainLoop wx.PyApp.MainLoop(self) File C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line 7289, in MainLoop return _core_.PyApp_MainLoop(*args, **kwargs) File c:\dabo\dabo\ui\uiwx\dControlMixin.py, line 27, in _onWxHit self.raiseEvent(dEvents.Hit, evt, *args, **kwargs) File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 949, in raiseEvent super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs) File c:\dabo\dabo\lib\eventMixin.py, line 93, in raiseEvent bindingFunction(event) File c:\pyproject\pespy\RptForm1.py, line 200, in doReport reportGroupDS=reportDS.execute('select dataset.*, demailtype, dusps from dataset join ds1 d on d.pkid=dataset.pkid', cursorDict={'ds1':ds1}) File c:\dabo\dabo\db\dDataSet.py, line 373, in execute self._populate(ds, alias) File c:\dabo\dabo\db\dDataSet.py, line 303, in _populate self._cursor.execute(self._makeCreateTable(ds, alias)) --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html My understanding of the use of this feature is for sub-queries of the current datasets. Therefore, I think this is a bug. Reading the code it appears to me that the dDataSet.py assumes that the table does not exist and always attempts to create the DB. That of course will cause an error if the table already exist. If the table exist it should be dropped then re-created as required. Larry I think this should be a ticket. You should not have to manually drop the table to re-use the same select statement with different params. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904170832.00816.jfabi...@yolo.com
Re: [dabo-users] Executing stored procedure - how?
On Friday 17 April 2009 08:35:00 am Sibylle Koczian wrote: No - a temp cursor is independent of the bizobj that created it. So newTempCursor = self.PrimaryBizObj.getTempCursor() is completely independent of the primary bizobj. Yes - but I want to know something else: what happens to my existing dataset, if I execute a stored procedure (executable, not selectable) with the execute method of the bizobj, not with a temporary cursor? Thank you, Sibylle I guess I missed that difference. But I question the reason for using the same bizobj to retrieve the data and also send executes. And how would you send the execute - by changing the userSQL of the bizobj? I suggest you experiment and I doubt it will work. But IMO just use a temp cursor. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904170845.08724.jfabi...@yolo.com
Re: [dabo-users] dDropDownlist different on windows
On Wednesday 15 April 2009 07:41:31 pm Adrian Klaver wrote: On Tuesday 14 April 2009 7:04:15 pm johnf wrote: On Tuesday 14 April 2009 06:57:11 pm Ed Leafe wrote: On Apr 14, 2009, at 8:45 PM, johnf wrote: This a platform issue. I have run the choice.py from wxPython demo on both platforms and as I reported the keyboard works on the windows but not on the linux side. Any chance you are aware of what is happening between the platforms? Or how I might add the function on Linux? It is generally a bad idea to change the standard behavior of an OS. People from the Windows world balk at the different standards on Mac OS, and spend a lot of effort getting things to work like they do on Windows. You might see if there is a Gtk-level setting that can affect this behavior. Otherwise, I would accept it as correct behavior. -- Ed I had not considered that point of view. However, I do like what standard choice.py is doing on windows. It would be nice to add the same abilities on the Linux side. Thanks for the hint - Gtk-level setting. This is something I am interested in also. In doing some research I ran across: http://wiki.wxpython.org/TextCtrlAutoComplete Looks promising. Thanks Adrian - this does look very interesting. Have you wrapped it for Dabo? -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904160703.58068.jfabi...@yolo.com
Re: [dabo-users] Mysql
On Thursday 16 April 2009 11:29:21 am Uwe Grauer wrote: Where is the the binary psycopg2 windows installer? http://www.stickpeople.com/projects/python/win-psycopg/ -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904161205.44185.jfabi...@yolo.com
[dabo-users] dataset's and joins
In the doc for dDataSet.py If you want to do multi-dataset joins, you need to pass the additional DataSet objects in a dictionary, where the value is the DataSet, and the key is the alias used to reference that DataSet in your join statement. I don't understand what the above means. Does someone have example of how that is suppose to work? I would like to use two datasets joined on the FK and PK. -- John Fabiani ___ Post Messages to: Dabo-users@leafe.com 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/200904161209.59200.jfabi...@yolo.com