Re: [dabo-users] Dabo Question

2011-11-06 Thread John Fabiani
On Sunday, November 06, 2011 06:14:34 am Jeff Johnson wrote:
 Ed:  You worked on a project where the data was stored on a web site and
 the application downloaded to the desktop and connected to the data on
 the web.  I forgot what it was called.  Maybe Slingshot.  I would like
 to look at that if it is still available.  Maybe you can point me to it.
 
 Thanks,


Springboard - just use SVN and you'll get it along with the rest of Dabo.
http://dabodev.com/download

svn checkout http://svn.dabodev.com/dabo/trunk dabo-trunk

Johnf


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
___
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/20060813.12922.jo...@jfcomputer.com


Re: [dabo-users] row locking

2011-10-31 Thread John Fabiani
On Monday, October 31, 2011 05:40:25 am Thomas Ganss wrote:
 Hi John,
 
 I recently scanned the code to get an idea of the changes necessary to
 implement
 a basic conflict resolution at least on time stamps.
 
 The code to delete back then AFAIR did not check if SQL-delete was
 successful.
 If my visualization was correct,  any rowlock could then probably be
 problematic,
 as the biz layer would be out of synch with the backend.
 
 I did not check if exeptions were raised if/when delete from DABO fails
 due to rows locked, which I could have done via backend interface...
 
 regards
 
 thomas

In my case I'm using Postgres and have Advisory Locks available.  I having 
been thinking I could use some/all of the bizObj.before() hook methods to 
check on the advisory lock.  That said I was hoping for more discussion on the 
matter because I know others must have similar needs of the Dabo framework.

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/201110310745.56498.jo...@jfcomputer.com


Re: [dabo-users] row locking feature

2011-10-31 Thread John Fabiani
On Monday, October 31, 2011 09:43:49 am Vineet Deodhar wrote:
  John Fabiani schrieb:
  Hi Guys,
  
  I like to know the thinking on row locking within the context of the
  Dabo framework.  We all realize that in some cases it is not desirable
  to have optimistic locking (or the MVCC locking of Postgres).  For
  example shipping/closing a sales order but allowing a second user to
  modify the same sales order at the same time.
  
  To my knowledge Dabo does not provide any tools to assist with
  pessimistic locking.  So I wonder if there have been any discussions on
  row locking etc.. Of course Postgres also makes the problem a little
  more complex due the different select modes (select for update,
  etc..).
  
  Of course general thoughts etc. are more than welcome.
  
  Johnf
 
 Row-locking in dabo is desirable IMHO.
 That reminds me of record locking in VFP CursorAdapter.
 I do not think it would be difficult to deal with any potential record
 locking problem.
 Error messages can be tackled appropriately through the hook methods in
 dabo.
 I vote +1 for row locking feature.
 
 --- Vineet

I guess I wasn't asking for a vote if we should have it or not.  Just looking 
for a general discussion on how it might be added.  But thanks for the vote 
anyway.

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/201110310950.26935.jo...@jfcomputer.com


[dabo-users] row locking

2011-10-29 Thread John Fabiani
Hi Guys,

I like to know the thinking on row locking within the context of the Dabo 
framework.  We all realize that in some cases it is not desirable to have 
optimistic locking (or the MVCC locking of Postgres).  For example 
shipping/closing a sales order but allowing a second user to modify the same 
sales order at the same time.

To my knowledge Dabo does not provide any tools to assist with pessimistic 
locking.  So I wonder if there have been any discussions on row locking etc..  
Of course Postgres also makes the problem a little more complex due the 
different select modes (select for update, etc..).

Of course general thoughts etc. are more than welcome.

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/201110290938.21917.jo...@jfcomputer.com


[dabo-users] new error from dDateTextBox

2011-10-27 Thread John Fabiani
This is new. 

I have a dDateTextBox in which I type a valid date string.  I now get this 
printed on the console.

2011-10-27 16:44:08 - ERROR - !!! Data Type Mismatch: table=public.esenroll; 
field=enrolled. Expecting: type 'datetime.date'; got: type 'unicode'



Reviewing the dCursorMixin.py I do not see how the a date string value 
(u'10/20/2011') with a field datatype date can pass the tests starting at 
line ~1020.  The user types in a date string can the setFieldVal will issue 
the error message.

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/201110271710.46508.jo...@jfcomputer.com


Re: [dabo-users] new error from dDateTextBox

2011-10-27 Thread John Fabiani
On Thursday, October 27, 2011 05:24:00 pm Paul McNett wrote:
 On 10/27/11 5:10 PM, John Fabiani wrote:
  This is new.
 
 Since what revision?
 
 Paul

I don't know at the moment.  Trying to find it now.


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/201110271727.17867.jo...@jfcomputer.com


Re: [dabo-users] new error from dDateTextBox

2011-10-27 Thread John Fabiani
On Thursday, October 27, 2011 05:27:17 pm John Fabiani wrote:
 On Thursday, October 27, 2011 05:24:00 pm Paul McNett wrote:
  On 10/27/11 5:10 PM, John Fabiani wrote:
   This is new.
  
  Since what revision?
  
  Paul
 
 I don't know at the moment.  Trying to find it now.
 
 
 Johnf

I have gone back a long ways - it must be my code somehow.  I'm guessing I did 
not notice it in the past.  The only question - what could be causing it?  All 
I do is type in the date and the error appears (as soon as I tab off).  It 
happens on Linux and windows.

Any suggestions?

gs1.append(dabo.ui.dDateTextBox(self, RegID = 'pes_enrolled', TabStop = False, 
BackColor = 'wheat', Width=150,ExtendedCalendar=True,DataSource 
=self.Form.esenroll, DataField = enrolled))

That's the code?  The code is on a dabo.ui.dScrollPanel that's why the 
datasource uses self.Form.

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/201110271744.20250.jo...@jfcomputer.com


Re: [dabo-users] new error from dDateTextBox

2011-10-27 Thread John Fabiani
On Thursday, October 27, 2011 05:44:20 pm John Fabiani wrote:
 On Thursday, October 27, 2011 05:27:17 pm John Fabiani wrote:
  On Thursday, October 27, 2011 05:24:00 pm Paul McNett wrote:
   On 10/27/11 5:10 PM, John Fabiani wrote:
This is new.
   
   Since what revision?
   
   Paul
  
  I don't know at the moment.  Trying to find it now.
  
  
  Johnf
 
 I have gone back a long ways - it must be my code somehow.  I'm guessing I
 did not notice it in the past.  The only question - what could be causing
 it?  All I do is type in the date and the error appears (as soon as I tab
 off).  It happens on Linux and windows.
 
 Any suggestions?
 
 gs1.append(dabo.ui.dDateTextBox(self, RegID = 'pes_enrolled', TabStop =
 False, BackColor = 'wheat', Width=150,ExtendedCalendar=True,DataSource
 =self.Form.esenroll, DataField = enrolled))
 
 That's the code?  The code is on a dabo.ui.dScrollPanel that's why the
 datasource uses self.Form.
 
 Johnf


I think I have figured it out.  

ustr(fldType) returns
utype 'datetime.date'

dtStrings = (type 'DateTime', type 'Date', type 
'datetime.datetime')

My fldType is not in the dtString.

I believe it should be.

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/201110271752.01443.jo...@jfcomputer.com


Re: [dabo-users] log INSERT statements

2011-10-26 Thread John Fabiani
On Wednesday, October 26, 2011 09:21:40 am Ed Leafe wrote:

  When you have the dbActivityLog directed to the console, you should see
  all UPDATE, INSERT, SELECT, and DELETE statements.
 
   To do this, run your app, and then open up a Command Window. Run these
 commands:
 
 import logging
 dabo.dbLogConsoleLevel=logging.DEBUG
 [h.setLevel(logging.DEBUG) for h in dabo.dbActivityLog.handlers]
 
   This will make sure that every db action is logged to the console.
 
 
 
 -- Ed Leafe

That's nice.  Maybe it should be on the wiki.

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/201110260935.39740.jo...@jfcomputer.com


Re: [dabo-users] Multiple bizobjs for the same table

2011-10-12 Thread John Fabiani
On Wednesday, October 12, 2011 07:30:31 am Ed Leafe wrote:
 On Oct 11, 2011, at 4:48 AM, Jacek Kałucki wrote:
  One of the limitations of Dabo form data manager is inability to manage
  multiple bizobjs of the same data source.
  It's because the target resolution is based on DataSource property, which
  could be the same for multiple data objects.
 
   This was definitely not something that we designed for; the presumption
 was one table, one bizobj.
 
   I'm wondering if adding a DataAlias property would help. This would 
 allow
 you to specify an alias for a bizobj that shares the same DataSource as
 another. DataSource would still be used to link to the underlying table,
 but DataAlias would be used when retrieving a bizobj reference; it would
 default to DataSource if no alias is set.
 
   Does that sound reasonable?
 
 
 
 -- Ed Leafe

IMO I don't see much of an advantage.  I think I can do that now.  In my case 
the reason I need to have a second bizobj with a already used data source is 
to use it like any other bizobj.  IOW/s my needs follow the VFP use again 
feature.  Currently I create views or use direct executes to create datasets.

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/201110120737.56281.jo...@jfcomputer.com


Re: [dabo-users] Annexure to my earlier post

2011-10-12 Thread John Fabiani
On Wednesday, October 12, 2011 07:41:36 am Ed Leafe wrote:
 On Oct 11, 2011, at 10:34 AM, Vineet Deodhar wrote:
  Excuse me, I missed one more point to ask in earlier post.
  
  In appendDataSet() method, updateInternals=False by default.
  For better understanding of dabo system, can I know why it is not not set
  to True by default. What is the basic purpose of this property?
 
   Dabo keeps track of the status of a record through the use of various
 internal flags. When you add/edit/delete records through the framework,
 those flags are updated. When you add records by appendDataSet(), though,
 those flags were not touched; the data was simply added to the cursor's
 records. Jacek added the option of having these flags updated, but left
 the defaults to False so as not to change the existing behavior of the
 methods.
 
   However, having looked over this, I think that we have two use cases: 
when
 working with a cursor object directly, or when working with bizobjs. In
 the former case, I think that the current behavior is correct: if you are
 working at that level, you should control things directly. However, when
 working with bizobjs, I think that the default should be to update the
 internals, since you are expecting bizobj-like behavior, which insulates
 the developer from the data layer underpinnings.
 
   Any objection to changing the default for updateInternals in the bizobj
 method signature to True?
 
 
 -- Ed Leafe

-1
If I recall this caused an issue with my code.  Could you provide the commit 
number and I could check into it further.

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/201110120756.30509.jo...@jfcomputer.com


Re: [dabo-users] Annexure to my earlier post

2011-10-12 Thread John Fabiani
On Wednesday, October 12, 2011 09:34:26 am Paul McNett wrote:
 On 10/12/11 7:56 AM, John Fabiani wrote:
  -1
  If I recall this caused an issue with my code.  Could you provide the
  commit number and I could check into it further.
 
 Let me svn that for you:
 
 {{{
 mac:~ pmcnett$ cd dabo
 mac:dabo pmcnett$ cd dabo
 mac:dabo pmcnett$ cd biz
 mac:biz pmcnett$ svn blame dBizobj.py | grep -i updateinternals
6850 JacekKdef appendDataSet(self, ds, updateInternals=False):
6850 JacekKself._CurrentCursor.appendDataSet(ds,
 updateInternals=updateInternals)
 mac:biz pmcnett$ svn diff -r 6849:6850 | grep -in2 updateinternals
 44-
 45--  def appendDataSet(self, ds):
 46:+  def appendDataSet(self, ds, updateInternals=False):
 47-   
 48-   Appends the rows in the passed dataset to this bizobj's 
dataset. No
 checking --
 52-   
 53--  self._CurrentCursor.appendDataSet(ds)
 54:+  self._CurrentCursor.appendDataSet(ds,
 updateInternals=updateInternals) 55-
 56-
 mac:biz pmcnett$ svn log -r 6850
 
 r6850 | JacekK | 2011-09-20 05:19:10 -0700 (Tue, 20 Sep 2011) | 4 lines
 
 - Finally, I decided to remove isAnyChanged() method call from isChanged.
 This avoids false positives for all child cursors when only one grandchild
 cursor is changed.
 The isAnyChanged method remains unchanged and is still fast but not so
 precise as isChanged.
 - The appendDataSet method gains extended functionality and allows to
 update cursor internals: temporary key value and new flag.
 
 
 }}}
 
 So your commit number is 6850, on Sept. 20.
 
 Paul

thanks Paul.

I guess I will remove my objection.  This does not appear to be the commit 
that broke my code.  I think it had something to do with the fact I open an 
empty form and that was resolved by adding a flag.

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/201110121056.41945.jo...@jfcomputer.com


Re: [dabo-users] Multiple bizobjs for the same table

2011-10-12 Thread John Fabiani
On Wednesday, October 12, 2011 03:45:35 pm Paul McNett wrote:
 On 10/12/11 3:23 PM, Ed Leafe wrote:
  On Oct 12, 2011, at 3:20 PM, Jacek Kałucki wrote:
This is what I proposed years ago in #1318.
Personally, I'm using this code in my business layer.
If you agree, I can implement it.
  
  I guess that this is needed, even though I can't really see the value.
  Go ahead and add it.
 
 I've never needed this, but then again I've never needed plenty of things
 in Dabo. It is an issue that comes up regularly, and it won't hurt
 anything, so yes please add it.
 
 Paul


Tell me will this DataAlias property allow me to access the same datasouce and 
move the record pointer in one without changing the record pointer in the 
others?


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/201110121559.08871.jo...@jfcomputer.com


Re: [dabo-users] Multiple bizobjs for the same table

2011-10-12 Thread John Fabiani
On Wednesday, October 12, 2011 06:34:05 pm Ed Leafe wrote:
 On Oct 12, 2011, at 5:59 PM, John Fabiani wrote:
  Tell me will this DataAlias property allow me to access the same
  datasouce and move the record pointer in one without changing the record
  pointer in the others?
 
   It will allow you to differentiate between multiple bizobjs that all 
 work
 with the same underlying table. Each bizobj has its own set of cursors, so
 record pointers are not in conflict, since that is relative to each
 cursor's data set.
 
 
 -- Ed Leafe

Then I want it yesterday!  Thanks!

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/201110121841.1.jo...@jfcomputer.com


[dabo-users] ODBC for MsSQL

2011-09-17 Thread John Fabiani
Hi,
I have working code that uses the pyodbc.py as the connection module to MsSQL 
server.  Unfortunately, I haven't the time to recode the other modules namely 
the CxnEditor, or the AppWizard (might not need to do anything here) to 
support the new pyodbc.py.  Currently working on some qt scripting (it's 
driving crazy) and will be for sometime.  So what I have is a dbMSOdbc.py that 
uses a hard coded connection string.  The code works well (including working 
with ClassDesigner) and testing has found no errors.

If anyone needs this immediately just give a shout and I'll send it to you.  
I'm not committing because it's not ready (due to lack of support for the 
other required functions like a way to create the connection string).

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/201109170858.18479.jo...@jfcomputer.com


Re: [dabo-users] Class for saving unrelated related bizobjs in single transaction

2011-09-10 Thread John Fabiani
On Saturday, September 10, 2011 02:13:59 am Vineet Deodhar wrote:
 I am writing a script (actually a hack to Ed's code in
 http://leafe.com/archives/msg/379103) for saving un-related  related
 bizobjs in single transaction (in web2py) 
 code start-
  
 class DE():
 
 class for saving related  unrelated bizobjs in a single transaction
 
 def __init__(self, paernT, unrelatedT):
 
 'parenT' is a list of related tables required in Form
 First table from the parenT list will be taken to begin transaction
 'unrelatedT' is a list of unrelated tables required in Form
 
 self.paernT = paernT
 self.unrelatedT= unrelatedT

 def saveT(self):
 self.paernT[0].beginTransaction()
 try:
 #Here, save method of bizobj class is called with
 'startTransaction=False' since already a transaction is started. #If this
 subset is taken in a separate transaction, it might be committed
 atomically. #Eventually, if the main transaction rolls back, this atomic
 change would be already committed to the DB. for i in partnT:
 self.paernT.save(startTransaction=False)
 for j in self.unrelatedT:
 j.save(startTransaction=False)
 except:
 self.paernT[0].rollbackTransaction
 else:
 self.paernT[0].commitTransaction())code end-
  
 I did not digest the purpose of re-writing isTransactionManager =
 self._getTransactionToken() (in Ed's class) since the same code is there
 in beginTransaction method of dBizobj.py. 
 Also pl. give me your comments/suggestions on the above given code (it is a
 work-in-progress). 
 Thanks,
 Vineet

To my eye I think it will work.  Of course I wonder if the transactions 
(unrealtedT) are truly unrelated than why have them in the same 'try'?

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/201109100705.40608.jo...@jfcomputer.com


Re: [dabo-users] (Why) saving unrelated related bizobjs in single transaction

2011-09-10 Thread John Fabiani
On Saturday, September 10, 2011 09:00:20 am Vineet Deodhar wrote:
  I did not digest the purpose of re-writing isTransactionManager =
  self._getTransactionToken() (in Ed's class) since the same code is there
  in beginTransaction method of dBizobj.py.
  Also pl. give me your comments/suggestions on the above given code (it is
  a work-in-progress).
  Thanks,
  Vineet
 
 To my eye I think it will work.  Of course I wonder if the transactions
 (unrealtedT) are truly unrelated than why have them in the same 'try'?
 
 Johnf
 ==
 John,
 In some cases, I require unrelated sets in single transaction.
 e.g. There is a car repair workshop which opens a jobcard when a vehicle
 reports for service. Most of the tables (e.g. spare parts, labour
 operations, complaints, etc.) are linked. So no problem in that. But for
 posting the money receipt, there is a separate table. That table is not
 linked (on purpose). The financial effects are given in a separate module
 (unrelated to main module of car workshop) as per client's requirements.
 If I take them in different transactions, and suppose the job is billed
 (committed) but error encountered in posting financial effect. Then there
 will be no finance entry, but only job closed entry.
 Or vice versa.
  
 Thanks for looking into my code.
  
 ---Vineet

OK that makes sense.  

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/201109100919.01219.jo...@jfcomputer.com


[dabo-users] ClassDesigner broken

2011-08-19 Thread John Fabiani
Hi,
I'm just playing and discovered on my systems (windows, linux) with the latest 
Dabo ClassDesigner is broken:
From Linux  and python 2.6 I get:
The program 'python' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 4635 error_code 8 request_code 151 minor_code 5)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.

Of course that for the 'C'  or 'C++' guys.



From windows / python 2.7 I get:

No real menu from a right click on the main form/window - just a bunch of 
menuitem's.



from windows python 2.6 I get after right clicking on the main window:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administratorcd \dabo\ide

C:\dabo\idepython ClassDesigner.py
Traceback (most recent call last):
  File C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py, line 
1357
, in Notify
self.notify()
  File C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line 
1474
2, in Notify
self.result = self.callable(*self.args, **self.kwargs)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
self.raiseEvent(dEvents.Update)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, 
**kwargs)
  File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
bindingFunction(event)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
self.update()
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
self.raiseEvent(dEvents.Update)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, 
**kwargs)
  File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
bindingFunction(event)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
self.update()
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
self.raiseEvent(dEvents.Update)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, 
**kwargs)
  File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
bindingFunction(event)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
self.update()
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
self.raiseEvent(dEvents.Update)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, 
**kwargs)
  File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
bindingFunction(event)
  File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
self.update()
  File c:\dabo\dabo\ui\dDataControlMixinBase.py, line 117, in update
self.__dataUpdate()
  File c:\dabo\dabo\ui\dDataControlMixinBase.py, line 179, in __dataUpdate
self.Value = srcatt
  File c:\dabo\dabo\ui\uiwx\dControlItemMixin.py, line 393, in _setValue
self.StringValue = value
  File c:\dabo\dabo\ui\uiwx\dControlItemMixin.py, line 367, in 
_setStringValue

raise ValueError(_(String must be present in the choices: '%s') % 
string)
ValueError: String must be present in the choices: ''

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/201108190911.49313.jo...@jfcomputer.com


Re: [dabo-users] ClassDesigner broken

2011-08-19 Thread John Fabiani
On Friday, August 19, 2011 09:11:49 am John Fabiani wrote:
 Hi,
 I'm just playing and discovered on my systems (windows, linux) with the
 latest Dabo ClassDesigner is broken:
 From Linux  and python 2.6 I get:
 The program 'python' received an X Window System error.
 This probably reflects a bug in the program.
 The error was 'BadMatch (invalid parameter attributes)'.
   (Details: serial 4635 error_code 8 request_code 151 minor_code 5)
   (Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.
 
 Of course that for the 'C'  or 'C++' guys.
 
 
 
 From windows / python 2.7 I get:
 
 No real menu from a right click on the main form/window - just a bunch of
 menuitem's.
 
 
 
 from windows python 2.6 I get after right clicking on the main window:
 
 Microsoft Windows XP [Version 5.1.2600]
 (C) Copyright 1985-2001 Microsoft Corp.
 
 C:\Documents and Settings\Administratorcd \dabo\ide
 
 C:\dabo\idepython ClassDesigner.py
 Traceback (most recent call last):
   File C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\_misc.py, line
 1357
 , in Notify
 self.notify()
   File C:\python26\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py, line
 1474
 2, in Notify
 self.result = self.callable(*self.args, **self.kwargs)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
 self.raiseEvent(dEvents.Update)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
 super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
 **kwargs)
   File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
 bindingFunction(event)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
 self.update()
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
 self.raiseEvent(dEvents.Update)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
 super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
 **kwargs)
   File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
 bindingFunction(event)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
 self.update()
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
 self.raiseEvent(dEvents.Update)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
 super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
 **kwargs)
   File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
 bindingFunction(event)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
 self.update()
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1347, in update
 self.raiseEvent(dEvents.Update)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1045, in raiseEvent
 super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args,
 **kwargs)
   File c:\dabo\dabo\lib\eventMixin.py, line 72, in raiseEvent
 bindingFunction(event)
   File c:\dabo\dabo\ui\uiwx\dPemMixin.py, line 1327, in __onUpdate
 self.update()
   File c:\dabo\dabo\ui\dDataControlMixinBase.py, line 117, in update
 self.__dataUpdate()
   File c:\dabo\dabo\ui\dDataControlMixinBase.py, line 179, in
 __dataUpdate self.Value = srcatt
   File c:\dabo\dabo\ui\uiwx\dControlItemMixin.py, line 393, in _setValue
 self.StringValue = value
   File c:\dabo\dabo\ui\uiwx\dControlItemMixin.py, line 367, in
 _setStringValue
 
 raise ValueError(_(String must be present in the choices: '%s') %
 string)
 ValueError: String must be present in the choices: ''
 
 Johnf

From Linux openSUSE 11.4, python 2.7 is seems to be working???

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/201108190915.50559.jo...@jfcomputer.com


Re: [dabo-users] Error in _getRecord() of dCursorMixin()

2011-08-18 Thread John Fabiani
On Thursday, August 18, 2011 06:34:37 am Vineet Deodhar wrote:
 Hi !
 As stated earlier on this list, I am using standalone 'bizobj' class with
 'web2py'. I imported the entire dabo folder in my app.
 Database server is MySQL DB.
 There is a parent bizobj named as 'statBizObj'; (it has a child bizobj
 named as 'distBizObj') 
 Upon encountering 'statBizObj.requery()' statement,
 exception is thrown when it runs 'requeryAllChildren()' method.
 I debugged via 'PyScripter'  could see that the bizobj can talk to the
 database  fetch rows. 
 When it encounters '_getRecord()' method in 'dCursorMixin()', following
 traceback is displayed:-- -Traceback (most recent
 call last):
 File F:\py\web2py\gluon\restricted.py, line 192, in restricted
 exec ccode in environment
 File F:/py/web2py/applications/mywheels/models/aafirst.py, line 54, in
 module statBizObj.requery()
 File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1098, in
 requery self.requeryAllChildren()
 File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1706, in
 requeryAllChildren child.requery()
 File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1063, in
 requery _childParamTuple = self.setChildLinkFilter()
 File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1130, in
 setChildLinkFilter (self.Parent.IsAdding and not self.ParentLinkField):
 File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 2528, in
 _isAdding return self._CurrentCursor.IsAdding
 File F:\py\web2py\site-packages\dabo\db\dCursorMixin.py, line 2823, in
 _getIsAdding getattr(self.Record, kons.CURSOR_TMPKEY_FIELD)
 File F:\py\web2py\site-packages\dabo\db\dCursorMixin.py, line 2872, in
 _getRecord ret = self._cursorRecord = dabo.db._getRecord(self)
 AttributeError: 'module' object has no attribute '_getRecord'
 Code line in ''dCursorMixin()' is:
 ret = self._cursorRecord = dabo.db._getRecord(self)
  
 Pl. tell me where I may be mistaken.
 (for advising on this error, if you need any additional info about my code,
 pl. tell.) 
 Thanks,
 ---Vineet-

Please post your code at
http://dabo.codepad.org/
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/201108180656.21826.jo...@jfcomputer.com


Re: [dabo-users] codepad pasted: Error in _getRecord() of dCursorMixin()

2011-08-18 Thread John Fabiani
On Thursday, August 18, 2011 09:39:47 am Vineet Deodhar wrote:
 Dear John  other list-members,
 I have pasted the code on http://dabo.codepad.org/FBIoYWUe
 But it can't be run as it is.
 It requires web2py framework.
 Fortunately, its deployment is JUST copy  paste.
 If the code lines pasted there are not sufficient to debug, I can upload
 the entire code (25 MB) .zip file on yahoo  send the link in email. Pl.
 see if you can help in trapping the error.
  
 Thanks,
 Vineet
 From: John Fabiani jo...@jfcomputer.com
 To: Vineet Deodhar d_vin...@yahoo.com; Dabo Users list
 dabo-users@leafe.com Sent: Thursday, 18 August 2011, 19:26
 Subject: Re: [dabo-users] Error in _getRecord() of dCursorMixin()
 
 On Thursday, August 18, 2011 06:34:37 am Vineet Deodhar wrote:
  Hi !
  As stated earlier on this list, I am using standalone 'bizobj' class with
  'web2py'. I imported the entire dabo folder in my app.
  Database server is MySQL DB.
  There is a parent bizobj named as 'statBizObj'; (it has a child bizobj
  named as 'distBizObj')
  Upon encountering 'statBizObj.requery()' statement,
  exception is thrown when it runs 'requeryAllChildren()' method.
  I debugged via 'PyScripter'  could see that the bizobj can talk to the
  database  fetch rows.
  When it encounters '_getRecord()' method in 'dCursorMixin()', following
  traceback is displayed:-- -Traceback (most recent
  call last):
  File F:\py\web2py\gluon\restricted.py, line 192, in restricted
  exec ccode in environment
  File F:/py/web2py/applications/mywheels/models/aafirst.py, line 54, in
  module statBizObj.requery()
  File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1098, in
  requery self.requeryAllChildren()
  File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1706, in
  requeryAllChildren child.requery()
  File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1063, in
  requery _childParamTuple = self.setChildLinkFilter()
  File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 1130, in
  setChildLinkFilter (self.Parent.IsAdding and not self.ParentLinkField):
  File F:\py\web2py\site-packages\dabo\biz\dBizobj.py, line 2528, in
  _isAdding return self._CurrentCursor.IsAdding
  File F:\py\web2py\site-packages\dabo\db\dCursorMixin.py, line 2823, in
  _getIsAdding getattr(self.Record, kons.CURSOR_TMPKEY_FIELD)
  File F:\py\web2py\site-packages\dabo\db\dCursorMixin.py, line 2872, in
  _getRecord ret = self._cursorRecord = dabo.db._getRecord(self)
  AttributeError: 'module' object has no attribute '_getRecord'
  Code line in ''dCursorMixin()' is:
  ret = self._cursorRecord = dabo.db._getRecord(self)
 
  
 
  Pl. tell me where I may be mistaken.
  (for advising on this error, if you need any additional info about my
  code, pl. tell.)
  Thanks,
  ---Vineet-
 
 Please post your code at
 http://dabo.codepad.org/
 Johnf


Please try moving a little code
statBizObj = PublicStatBizobj(oConn)
distBizObj = PublicDistBizobj(oConn)
distBizObj.ParentLinkField = 'statid'
   
distBizObj.LinkField = 'statid'
distBizObj.FillLinkFromParent = True
statBizObj.addChild(distBizObj)

You do not need to distBizObj.requery() - it is the child of the parent (stat) 
and the requery it is done for you in Dabo.
Also I believe you wanted to show all the records from 'dist' with the 
associated 'statid'.   I thought you understood
you needed to add a third datasource.  I believe I provide several ways to get 
that done.  Or you could reverse the
parent and child relationship and display all of the records from dist in a 
grid.  If the number of records in 
dist will be small (less than 1000) you will not have to touch the 'limit'.

Johnf 



--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
___
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/201108181124.59384.jo...@jfcomputer.com


Re: [dabo-users] I have blue lines

2011-08-18 Thread John Fabiani
On Thursday, August 18, 2011 11:19:05 am Jim Byrnes wrote:
 What happens if you change your theme?  A while back I thought I had a 
 problem with the datePicker not highlighting my selection.  Then I 
 changed my theme for a totally unrelated reason and I started to see the 
 proper highlighting.
 
 Regards,  Jim

I haven't thought about that!  But of course I just started noticing it (IOW 
it wasn't there in the past).  I've made a lot of changes trying to remove 
them and have found some success (removed all but one).  But I have no clue it 
really comes from.  I'll check out the theme by changing it.  

Thanks,

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/201108181129.24845.jo...@jfcomputer.com


Re: [dabo-users] I have blue lines

2011-08-18 Thread John Fabiani
On Thursday, August 18, 2011 11:49:42 am Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  class HeaderToolBar(dabo.ui.dPanel):
 Base question.
 Why are you using dPanel instead of dToolBar control as tools container?

I couldn't get the icon large enough  (if memory serves me) on the toolbar.

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/201108181201.59664.jo...@jfcomputer.com


Re: [dabo-users] I have blue lines

2011-08-18 Thread John Fabiani
On Thursday, August 18, 2011 12:05:35 pm Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  I couldn't get the icon large enough  (if memory serves me) on the
  toolbar.
 
 Are you using icons larger than 32pix?
 I thought that dToolBar can handle any icon size, but I used 32 max.
Yes they are larger - I have several clients that are having a hard time 
seeing the icons and in general the form (unless they enlarge the fonts etc.)  
So I used large icons.

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/201108181214.16737.jo...@jfcomputer.com


Re: [dabo-users] I have blue lines

2011-08-18 Thread John Fabiani
On Thursday, August 18, 2011 12:11:45 pm John Fabiani wrote:
 On Thursday, August 18, 2011 12:01:59 pm John Fabiani wrote:
  On Thursday, August 18, 2011 11:49:42 am Jacek Kałucki wrote:
   Użytkownik John Fabiani napisał:
class HeaderToolBar(dabo.ui.dPanel):
   Base question.
   Why are you using dPanel instead of dToolBar control as tools
   container?
  
  I couldn't get the icon large enough  (if memory serves me) on the
  toolbar.
  
  Johnf
 
 Adrian Klaver wrote:
 It seems to come from code below in dBitmapButton.py:
 
 def _getBorderStyle(self):
  if self._hasWindowStyleFlag(wx.BU_AUTODRAW):
  return Simple
  
  elif self._hasWindowStyleFlag(wx.NO_BORDER):
  return None
  
  else:
  return Default
 
 If you change the Simple in the first test to None then the line
 goes away.
 
 I have tried setting BorderStyle = 'None' but I still get the blue lines.
 
 Johnf

If I do a self.refresh() the blue lines go away.

Also it's same on python 2.6.6 and 2.7 only on openSUSE 11.3 and 11.4.

Both have wxPython 2.8.11.0

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/201108181219.24038.jo...@jfcomputer.com


[dabo-users] just fun - another Dabo

2011-08-18 Thread John Fabiani
http://gowalla.com/checkins/42704749

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/201108181437.27044.jo...@jfcomputer.com


Re: [dabo-users] I have blue lines

2011-08-18 Thread John Fabiani
On Thursday, August 18, 2011 03:01:29 pm Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  Yes they are larger - I have several clients that are having a hard time
  seeing the icons and in general the form (unless they enlarge the fonts
  etc.) So I used large icons.
 
 Here, you have dToolBar with 128 pix size tools:
 http://imageshack.us/photo/my-images/40/dtoolbar128.jpg/

Thanks I'll look into using the toolbar.

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/201108181520.22787.jo...@jfcomputer.com


[dabo-users] I have blue lines

2011-08-17 Thread John Fabiani
Hi,
I posted a picture
http://imageshack.us/photo/my-images/59/daboheader.png/

I have these blue lines around one of the dBitmapButtons.  Anybody know where 
they are coming from???

The code below is what creates the buttons:

class HeaderToolBar(dabo.ui.dPanel):
def afterInit(self):
self.RegID='headertoolbarID'
self.Sizer = mytoolbar = dabo.ui.dSizer('h')
mytoolbar.appendSpacer(3)
mytoolbar.append(dabo.ui.dBitmapButton(self, TabStop = False, 
RegID=btnEditID, Picture=edit-all.png,BorderWidth=1,ToolTipText=Allow 
Edit,OnHit=self.onEdit))
mytoolbar.appendSpacer(5)
  
mytoolbar.append(dabo.ui.dBitmapButton(self, TabStop = False, 
RegID=btnSaveID, Picture=document-save.png,BorderWidth=1,ToolTipText=Save 
or Update,OnHit=self.onSave))

mytoolbar.appendSpacer(5)

mytoolbar.append(dabo.ui.dBitmapButton(self, TabStop = False, 
RegID=btnClearID, Picture=edit-
clear.png,BorderWidth=1,ToolTipText=Clear,OnHit=self.onClear))
mytoolbar.appendSpacer(5)



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/201108171829.08614.jo...@jfcomputer.com


Re: [dabo-users] a better way to find if a field has changed

2011-08-16 Thread John Fabiani
On Tuesday, August 16, 2011 04:36:40 pm Paul McNett wrote:
 On 8/15/11 12:38 PM, Paul McNett wrote:
that's my point.  I'd like to use the field as a flag as part of a
series of flags (even considered a state machine).  But now I need a
field to tell me if there were any changes.
  
  def isFieldChanged(self, field_name, row=None):
  return self.getFieldVal(field_name, row) != self.oldVal(field_name,
  row)
 
 ...and if you want to find out, without asking, at the time a field value
 changes, something like this should work:
 
 class FieldValueChanged(dabo.dEvents.dEvent): pass
 
 class MyBizobj(...):
def afterSetFieldVal(self, fld, row):
  self.raiseEvent(FieldValueChanged, table=self.DataSource, field=fld,
 row=row)
 
 class MyForm(...):
def afterInit(self):
  ...
  self.bindEvent(FieldValueChanged, self.onFieldValueChanged)
 
def onFieldValueChanged(self, evt):
  table = evt.EventData.table
  field = evt.EventData.field
  row = evt.EventData.row
  # do stuff to visually indicate the change
 
 (untested but you get the gist)
 
 Paul

That's a lot better than what I came up with - I'll see if I can get it 
working.

Thanks
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/201108161701.17737.jo...@jfcomputer.com


[dabo-users] a better way to find if a field has changed

2011-08-15 Thread John Fabiani
Hi,
I need to know if a field has changed.  I can't just use oldVal().

oldVal() is none if no change has occurred or if the starting value is None.

I was thinking of bizobj._CurrentCursor.getDataDiff(False) and check to see if 
my field was there.  

Is there an easier way?

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/201108150909.30370.jo...@jfcomputer.com


Re: [dabo-users] a better way to find if a field has changed

2011-08-15 Thread John Fabiani
On Monday, August 15, 2011 12:27:54 pm Paul McNett wrote:
 oldVal() returns the old value, before any changes. So if it returns None,
 that was  the starting value

that's my point.  I'd like to use the field as a flag as part of a series of 
flags (even considered a state machine).  But now I need a field to tell me if 
there were any changes.

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/201108151235.16179.jo...@jfcomputer.com


Re: [dabo-users] BizObj, FK TempCursor

2011-08-12 Thread John Fabiani
On Thursday, August 11, 2011 11:09:45 pm Vineet Deodhar wrote:
  Another query in this regard -- How do I get all the records from 'dist'

 
 Here do you mean to say that -
 do not define any FK relation in bizoj; and handle all the DML stuff
 externally ? 
Yes - as it applies to gaining access to the same table a second time.

 
 
 This looks like the thing I was looking for.
 In my web-form, for displaying the entire contents from 'dist' table, I can
 use a tmpCursor. When a user selects a particular 'dist' record for making
 changes, filter will be set to the concerned 'statid' in 'distBizObj'. The
 CRUD form will make changes in 'distBizObj' (which can take care of the
 CRUD operations).
 
 Is this approach correct?
 Pl. tell me if anything is fishy in it?
 

What I provided will allow access to any table.  It is a general way to 
exercise any SQL statement.  IOW's it does not use Dabo special tools to 
access data.

But you have me confused.  

As I understand your needs you have a simple parent-child relationship. Where 
'dist' is a child of 'stat'.  So when you say you want to display all the 
records in 'dist' unfiltered I don't understand the reason.  Maybe you do not 
realize that it is possible to display all the filtered records at once?

I will make this up but I believe it is a typical situation that presents it's 
self to programmers daily.  You have a parent  (lets say 'stat') table and you 
have a child ('dist') table.  This relates to other parent-child relationship 
i.e Customers - orders.

With Dabo you would setup the relationship just like we have already done.  
Next you would create two grids,  Grid1 would contain the list of parents 
(stat) and Grid2 would contain the filtered records of the child (dist).

As you move to different rows in Grid1 the records will automatically change 
in Grid2 to match whatever row (record) is in Grid1.

I realize in your case you are not using Dabo's UI but the data still does the 
same thing (as above).  So all that would be required would for you to 
retrieve the data to display - is to move the record pointer in the parent 
(stat) and automatically the child (dist) record/s will come available for you 
to display.  You would display data using your javascript or the use of your 
wsgi system.

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/201108120652.26040.jo...@jfcomputer.com


Re: [dabo-users] 'LinkField' property causing strange behaviour

2011-08-11 Thread John Fabiani
On Thursday, August 11, 2011 04:33:10 am Vineet Deodhar wrote:
 Thanks John  Paul.
  
 ### (excessive quoting is removed for readability)
  
 I looked at the RowCount of distBizObj.
 It is only 2.
 There are total 31 records in the 'dist' table in MySQL DB.
 Upon looking closely, I found that the only those 'dist' records are
 fetched which have statid=1. For your ready ref., my modified code is like
 this---
  
 ### code start ###
 #connection object
 ci = dabo.db.dConnectInfo(Host='localhost', DbType='MySQL',
 Database='whlbel', User='root', PlainTextPassword='123') conn =
 dabo.db.dConnection(ci)
 class PublicDistBizobj(dabo.biz.dBizobj):
 def afterInit(self):
 self.DataSource ='dist'
 self.KeyField = 'distid'
 self.addFrom('dist')
 self.addField('distid')
 self.addField('distnm')
 self.addField('statid')
 self.NonUpdateFields = ['distid']
  
 class PublicStatBizobj(dabo.biz.dBizobj):
 def afterInit(self):
 self.DataSource = 'stat'
 self.KeyField = 'statid'
 self.addFrom('stat')
 self.addField('statid')
 self.addField('statnm')
 self.NonUpdateFields = ['statid']
  
 statBizObj = PublicStatBizobj(conn)
 distBizObj = PublicDistBizobj(conn)
 distBizObj.LinkField = 'statid'
 distBizObj.FillLinkFromParent = True
 statBizObj.addChild(distBizObj)
 statBizObj.requery()
 distBizObj.requery()
 ### code end ###
  
 At the interactive prompt, I tried this --
  
 
  from dabovmd import bo # 'bo.py' is in 'dabovmd' folder
  bo.distBizObj.RowCount
 
 2
 
  for rownum in bo.distBizObj.bizIterator():
 ... rec = bo.distBizObj.Record
 ... print rownum, rec.distid, rec.distnm, rec.statid
 ...
 0  1   stat1  1
 1  25  stat2  1
 (actually there are 31 recored in the MySQL DB)

That is correct.  What this is saying is
table stat is on the record with statid = 1

Therefore, table dist is filtered to only the records where
dist.statid = 1.  Even if there are 31 records in dist you will only see the 
records that relate to the stat table PK.  So whatever record you are on in 
stat will filter the records in dist.

If you changed the stat table (moved the record pointer) so that the table 
stat had a record where statid = 2 then the dist table would be filtered to 
all the records where dist.statid = 2 would appear (there may or may not be 
records with dist.statid=2)


  
 for table 'stat', the same procedure is working correctly.
 Then, just for testing, I commented out the following statement--
 #distBizObj.LinkField = 'statid'
This removes the parent -child relationship.

 And now I am getting all the 'stat' bizobj contents.
 I can seek() and setFieldVal() and save() it.
When your program did
statBizObj.requery() it retrieved the 'all' records for the table stat. If 
you add the following just below statBizObj.requery()

print statBizObj.RowCount

Please tell me what that prints - because that is the number of records that 
were retrieved.


 I think some filter is causing this behaviour, when the 'LinkField' is
 specified (only those rows with statid=1 are fetched from dist table). 
 Can you pl. suggest on the points below ---
  
 1) whether it is OK to comment-out that line?
IMO No.
 2) whether the PK of parent table would by default be taken as the FK in
 child table? (as we have addChild method called).
No that is incorrect
 3) Even if 1)  2) are OK, there will be a situation in cases where the FK 
is not the primary key of parent table ,but some other field in that table is 
FK for child table.  What to do in such cases?

Dabo does not care if the actual link field is a PK or not.  All that is 
required is the link field be there.  

Most parent -child relationships are one to many  but there are others (I 
will not discuss them until you get this fixed).  So far what you have 
provided is a straight forward parent-child.   As long as the parent table 
contains the link field and you setup the child table to have the FK as a 
field - Dabo can use it.

  
 Thanks,
 Vineet

___
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/201108110750.04202.jo...@jfcomputer.com


Re: [dabo-users] BizObj with FK: I almost got it right

2011-08-11 Thread John Fabiani
On Thursday, August 11, 2011 09:11:56 am Vineet Deodhar wrote:
 Another query in this regard -- How do I get all the records from 'dist'
 table? (without getting filtered by statid=somevalue?)
 

Ouch!  That question is somewhat harder to answer.  The cause of the trouble 
is that you already have created a connect to the table 'dist' and you have 
setup a filter(parent-child relation).  In general Dabo does not have a use 
table again feature.  

When I need to open the same table multiple time I do one of the following.

I create a view on the database server.  I of course name the view something 
different from the other tables.  Then I use the view just like any other 
table.  The only issue is normally a view is read only.   I use the postgres 
database and Postgres allows special rules to allow insert,update, and 
deletes.  I'm sure what MySQL has available for views.

The second way is to provide Dabo with all the information it needs to create 
a bizobj that matches the data structure of the table in question and handle 
all the methods required to save, update, delete, read.  see below to see how 
to execute the save,update, etc..

And the last way (might work depending on what you need to do with the data 
set).  Just create a dynamic data set by using a direct sql statement.

The steps are:
#get a cursor to hold the data
self.biztmp = dabo.biz.dBizobj(self.conn)
 # get a temp cursor to work with where self.conn is the connection to the 
database
self.tmpbiz = self.biztmp.getTempCursor()
# you can execute any sql statement next including joins etc..
self.tmpbiz.execute(Select * from dist)  

myDataSet = self.tmpbiz.getDataSet()

myDataSet now contain all the records retrieve from the table dist


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/201108111004.49230.jo...@jfcomputer.com


Re: [dabo-users] BizObj with FK: I almost got it right

2011-08-11 Thread John Fabiani
On Thursday, August 11, 2011 10:06:57 am Thomas Ganss wrote:
 If you don't link the biz objects, you select unfiltered from the DB.
 View the link as Inner Join-operation on the database tables,
 or a relation in foxpro terms if you come from that area.

Only problem is the updates, etc on tables with joins.  But this not only a 
Dabo problem all the ORM's I'm aware of have the same issues.

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/201108111012.21578.jo...@jfcomputer.com


Re: [dabo-users] standalone BizObj with FK relation not saving into database

2011-08-10 Thread John Fabiani
On Wednesday, August 10, 2011 02:34:01 am Vineet Deodhar wrote:
 #create stat bizobj
 statBizObj = dabo.biz.dAutoBizobj(conn)
 statBizObj.DataSource = 'stat'
 statBizObj.KeyField = 'statid'
 statBizObj.NonUpdateFields = ['statid']
 statBizObj.UserSQL = 'select * from stat'
 statBizObj.requery()
  
 #create dist bizobj
 distBizObj = dabo.biz.dBizobj(conn)
 distBizObj.KeyField = 'distid'
 distBizObj.ParentLinkField = 'statid'
 distBizObj.NonUpdateFields = ['distid']
 distBizObj.UserSQL = 'select distid,distnm,statid,statnm from dist join
 stat using(statid)' distBizObj.addChild(statBizObj)
 distBizObj.requery()

The way I'd do it.

class PublicDistBizobj(dabo.biz.dBizobj):
 def afterInit(self):
self.DataSource ='dist'
self.KeyField = 'distid'
self.addFrom('dist')
self.addField('distnm')
self.addField('statid')
self.NonUpdateFields = ['distid']


class PublicStatBizobj(dabo.biz.dBizobj):
   def afterInit(self):
 self.DataSource = 'stat'
 self.KeyField = 'statid'
self.addFrom('stat')
self.addField('statnm')
self.NonUpdateFields = ['statid']
# I do not need to provide a UserSQL because the default is to retrieve 
all fields


statBizObj = PublicStatBiz(conn)
 distBizObj = PublicDistBizobj(conn)
 distBizObj.ParentLinkField = 'statid'
 disBizObj.LinkField = 'statid'
distBizObj..FillLinkFromParent = True
statBizObj.addChild(distBizObj)

statBizObj.requery()

From your description 'dist' is a child of 'stat' (dist has the FK)

You might consider providing a 'Limit' statement.  Dabo's default 'Limit' is 
1000.  Using a class will allow Dabo to retrieve the data type along with the 
complete data structure.  

I think that will work.

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/201108100649.32389.jo...@jfcomputer.com


Re: [dabo-users] I tried class-based standalone BizObj : no success

2011-08-10 Thread John Fabiani
On Wednesday, August 10, 2011 09:44:40 am you wrote:
 @John,
 I tried with the class-based code as you have shown.
  
 seek()  setFieldVal() are working for 'statBizObj' only.
 But it is not working for 'distBizObj'.
 'Not Working' means, no value is fetched from the 'distBizObj' through
 seek(), although it is there in the database. 
 I could observe it through --
  
 
  for rownum in distBizObj.bizIterator():
  ... rec = distBizObj.Record
  ... print rownum, rec.distid, rec.distnm, rec.statid
 
  
 No result is printed.
  
 When tested on statBizObj the same way, result is fetched.
 I don't understand what's wrong with distBizObj.
 -
 
 @Thomas,
 I have made sure that there is a matching record in the second bizobj.
 -
  
 Any idea what may be wrong in this issue?
 ---Vineet
  


First you are better off posting to the list and not directly to me.  Others 
may see something I missed.  BTW I often mis-spell vars so check my spelling 
in case you just copied and pasted.

When the statBizObj.requery() runs it should retrieve the child records.  In 
this case the dist table is a child with the fk link of 'statid'.  Therefore, 
the statBizObj.seek(someVal, someField) moves the record pointer to the 
correct record in statBizObj.  I will assume you are using the PK as the field 
and value.  The moving of the record pointer will cause the child (dist) 
record to filter based on the FK (statid).  You may or may not have records 
that relate to 'stat' in 'dist'.  This a classic one to many relation.

So you need to determine 
1. what the PK is in stat try -  print statBizObj.Record.statid
If the PK is 0 or None you have nothing to retrieve. Either MovePK or 
seek(pk).

2.  you can check the row count of dist  - print distBizObj.RowCount()
That should tell how many records are retrieved.

To my knowledge there is nothing wrong with the one to many relation setup for 
Dabo.  It works and I use it all the time.

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/201108101129.10305.jo...@jfcomputer.com


[dabo-users] OT - for those moving data into Postgres or MySQL

2011-08-08 Thread John Fabiani
Hi,
If my chance you have a need to move data from MS SQL into Postgres or MySQL - 
here is a way to move the data into a TEXT file in seventeen lines of python.


http://catherinedevlin.blogspot.com/2011/08/mssql-to-csv.html

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/201108081113.24551.jo...@jfcomputer.com


Re: [dabo-users] Incorrect DataStructure

2011-08-07 Thread John Fabiani
On Sunday, August 07, 2011 11:30:41 am OKB (not okblacke) wrote:
 =?UTF-8?B?SmFjZWsgS2HFgnVja2k=?= wrote:
  UÅŒytkownik OKB (not okblacke) napisał:
I tracked down the source of the problem.  The issue is
that
  
  dCursorMixin uses DataStructure to determine whether the given
  column is valid for a sort.  The DataStructure code, in turn,
  relies on the BackendObject's getStructureDescription method.  But
  this method uses something called getStructureOnlySQL, and that
  uses getSQL --- bypassing the UserSQL.  The result is that, even
  when UserSQL is specified, the cursor tries to get the
  DataStructure by using the auto-generated SQL. This fails when
  custom SQL returns different columns than are present in the
  table, since then the actual results don't match the structure-
  only description.
  
  Hi.
  I guess that if you define your dBizobj.DataStructure manually in
  the class initProperties method, then everything should works fine.
  Try to do this.
 
   Yeah, that's actually what I wound up doing.  But it would still be
 good if there were a way to refresh this from the DB.  The only way I
 could figure out the format that DataStructure wanted was by getting the
 real one from the DB and copy-and-pasting it.  The documentation lists
 the six elements that the tuple is supposed to contain, but doesn't
 explain them (e.g., what is data type code?).

Below is a list from the dbPostgres.py which should provide a little insight 
to the data types.

fldTypeDict= {int4:I, int8:I, int2:I,varchar: C,  char: 
C,'bpchar': 'C', bool:B, text: M, numeric:N, double:F, 
real:F,float4:F, float8:F, datetime:T, timestamp:T, 
date: D,bytea: L, point:C, box:C, circle:C, lseg:C, 
polygon:C, path:C,oid:I}

Some where deep in the Dabo code there is an official list.  I can recall 
finding them years ago.  

Concerning your problem of having to create a dynamic grid data structure.  
Have you considered using a view?  It sounds like you are using the grid in a 
read only manner and you could use a view for read only interactions.  If by 
chance you are using Postgres - you can use Rules to allow inserts, deletes, 
and updates for views.

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/201108071139.49106.jo...@jfcomputer.com


Re: [dabo-users] Application error

2011-08-07 Thread John Fabiani
On Sunday, August 07, 2011 11:46:17 am Adrian Klaver wrote:
 On Sunday, August 07, 2011 11:40:00 am bob k. wrote:
  I’ve been following the step by step guide.  Everything has worked fine
  until I entered the following code in the dForm:
  
  def createBizobjs(self):
  conn = self.Applicaton.getConnectionByName(ChemicalsBizobj)
 
   spelling ^

Good catch! 

More reason I like my Wing editor.  It actually catches spelling errors like 
that by underlining the word.

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/201108071150.12942.jo...@jfcomputer.com


Re: [dabo-users] Application error

2011-08-07 Thread John Fabiani
On Sunday, August 07, 2011 12:14:00 pm bob k. wrote:
 uhhh.  I need to give my eyes a break.
 
 I actually have wing ide.  it can be used with dabo?  anything special I
 need to do?
 
 thank you,
 bob k.
 
 -Original Message-
 From: John Fabiani
 Sent: Sunday, August 07, 2011 2:50 PM
 To: Dabo Users list
 Subject: Re: [dabo-users] Application error
 
 On Sunday, August 07, 2011 11:46:17 am Adrian Klaver wrote:
  On Sunday, August 07, 2011 11:40:00 am bob k. wrote:
   I’ve been following the step by step guide.  Everything has worked fine
   until I entered the following code in the dForm:
   
   def createBizobjs(self):
   conn = self.Applicaton.getConnectionByName(ChemicalsBizobj)
   
spelling ^
 
 Good catch!
 
 More reason I like my Wing editor.  It actually catches spelling errors
 like that by underlining the word.
 
 Johnf

Nothing that I can recall.  A couple of years ago there was an error but that 
has been fixed - years ago.  Are you having any trouble?  

What version of Wing are you using?  The error you are getting should have 
appeared with a red underline in the editor when you typed the mis-spelled 
object.

Johnf
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/201108071615.24643.jo...@jfcomputer.com


Re: [dabo-users] dBitMapButton

2011-08-06 Thread John Fabiani
On Saturday, August 06, 2011 01:09:04 pm bob k. wrote:
 is it possible to add an image to a bitmap button.  The Object Info shows a
 ‘picture’ field but I’m unable to edit.
 
 bob k.

dabo.ui.dBitmapButton(self, TabStop = False, RegID=btnSaveID, 
Picture=document-save.png,BorderWidth=1,ToolTipText=Save or 
Update,OnHit=self.onSave)

The Picture the file name.

I think there is a second way too - but can't recall!

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/201108061312.27028.jo...@jfcomputer.com


Re: [dabo-users] 4 digit year

2011-08-05 Thread John Fabiani
On Friday, August 05, 2011 01:34:26 am Jacek Kałucki wrote:

 
 Hi.
 
 Personally, I use daboized wx.DatePickerCtrl class for date controls.
 I didn't publish it since I can't test it on OSX.
 If you wish I will send you the source.

cool - you mean you have it working with the mix-ins?

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/201108050625.15111.jo...@jfcomputer.com


[dabo-users] 4 digit year

2011-08-04 Thread John Fabiani
Hi,
I believe I used to force a four digit year in dDateTextBox.  But I can't 
recall how I forced it.

Can someone remind me - please!

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/201108041542.30750.jo...@jfcomputer.com


Re: [dabo-users] 4 digit year

2011-08-04 Thread John Fabiani
On Thursday, August 04, 2011 03:42:30 pm John Fabiani wrote:
 Hi,
 I believe I used to force a four digit year in dDateTextBox.  But I can't
 recall how I forced it.
 
 Can someone remind me - please!
 
 Johnf

I couldn't find anything so I wrote something that appears to work.  However, 
it only work for this century.  So i won't publish.

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/201108041915.56986.jo...@jfcomputer.com


Re: [dabo-users] Getting the old field value in Bizobj validate method

2011-07-19 Thread John Fabiani
On Tuesday, July 19, 2011 10:24:15 am Jacek Kałucki wrote:
 Użytkownik Nate Lowrie napisał:
  I know I've asked this before but for the life of me I can't find it.
  In the validation method of the bizobj, how do I 1) see what fields
  are changed and 2) compare an old field value to the current field
  value.
 
 Hi.
 
 What about dBizobj.getRecordStatus() method?

Or 
self.bizobj.oldVal('fieldName')

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/201107191031.35569.jo...@jfcomputer.com


Re: [dabo-users] Postgres temp table as bizobj - solved

2011-07-19 Thread John Fabiani
On Friday, July 15, 2011 01:36:54 pm John Fabiani wrote:
 Hi,
 Has anyone ever used a postgres temp table as the data source in a bizobj?
 
 I'd like to create a postgres temp table  - maybe in the createbizobj()
 then use it as a normal bizobj.  But - I'm not sure exactly how I'd set it
 up. Does anyone have any suggestions.
 
 Johnf

It could be much easier.  And I have been able to insert over 20,000 records.

1. have a connection

self.Application.addConnectFile(connFile.cnxml)
 self.conn = self.Application.getConnectionByName(ConnName)

Then I created a method in MainForm.

self.tempStudentBiz = self.createTempStudentTable(self.conn)

def createTempStudentTable(self, conn):
create_StudenttableStr = CREATE temporary TABLE tempstudent
(
  pkid integer,
  referral date,
  enrolled date,
  fname character varying(25),
  lname character varying(50),
  address character varying(60),
  address2 character varying(60),
  city character varying(120),
  state_1 character varying(2),
  zip character varying(10),
  fk_county integer,
  homephone character varying(16) DEFAULT '(   )-'::character varying,
  cell character varying(20) DEFAULT '(   )-'::character varying,
  accept_text boolean DEFAULT false,
  fk_cell_carrier integer DEFAULT 0,
  email character varying(80),
  dvrslic character varying(20),
  dvrslicst character varying(2),
  born date,
  ssn character varying(11),
  ethnic_grpid integer DEFAULT 0,
  languageid integer,
  gender character varying(10) DEFAULT 'Male'::character varying,
  longitude character varying(40),
  latitude character varying(40),
  caseno character varying(13),
  ref_no character varying(60),
  ref2_no text,
  ret_to_court date,
  mustenrollby date,
  incident_date date,
  fk_escourse integer,
  fk_escourts integer,
  fk_pccode integer DEFAULT 0,
  community_tobedeter boolean DEFAULT true,
  restitution_tobedeter boolean DEFAULT true,
  community_service integer DEFAULT 0,
  victim_name character varying(120),
  victim_address character varying(100),
  victim_address2 character varying(100),
  victim_city character varying(80),
  victim_zip character varying(15),
  victim_state_1 character varying(2),
  phone character varying(25),
  enroll_comments text,
  victim_comments text,
  community_comments text

)

biz = self.biz = dabo.biz.dBizobj(conn)
biz.execute(create_StudenttableStr)
biz.DataSource = 'tempstudent'
#biz.VirtualFields = 
biz.DefaultValues={referral: datetime.date.today,'born':None, 
'gender':'Male'}

biz.new()

return self.biz

___
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/201107191410.01196.jo...@jfcomputer.com


[dabo-users] Postgres temp table as bizobj

2011-07-15 Thread John Fabiani
Hi,
Has anyone ever used a postgres temp table as the data source in a bizobj?  

I'd like to create a postgres temp table  - maybe in the createbizobj() then 
use it as a normal bizobj.  But - I'm not sure exactly how I'd set it up.  
Does anyone have any suggestions.

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/201107151336.54686.jo...@jfcomputer.com


Re: [dabo-users] What is the dbMsSql status

2011-07-13 Thread John Fabiani
On Wednesday, July 13, 2011 05:35:08 am pyt...@bdurham.com wrote:
 Ed,
 
  Is there a possibility of using one of the Python ODBC modules?
  
  For raw access, yes. But these are not dbapi-compliant
 
 My understanding is that some of the ODBC modules are db-api compliant.
 
 1. pyodbc - Python ODBC library
 Windows, Linux, OS/X
 apilevel: The string constant '2.0' indicating this module supports DB
 API level 2.0.
 http://code.google.com/p/pyodbc/wiki/Module
 
 2. A fast MS SQL Server client library for Python directly using C API
 instead of ODBC.
 It is Python DB-API 2.0 compliant. Works on Linux, *BSD, Solaris, Mac OS
 X and Windows.
 http://code.google.com/p/pymssql/
 
 Perhaps you are thinking of the pywin32 ODBC module which is a Python
 wrapper for ODBC function calls vs. a db-api wrapper?
 
 Malcolm

Thanks for the link - I'll check into it further.  

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/201107130702.41236.jo...@jfcomputer.com


Re: [dabo-users] What is the dbMsSql status

2011-07-13 Thread John Fabiani
On Wednesday, July 13, 2011 08:32:34 am Jamie Adams wrote:
 John,
 
 Please keep us posted on your progress.  The last time I tried to work
 with MSSQL and Dabo, I was unsuccessful, but it has been a couple years.
 I'm curious to know the current state of MSSQL in Dabo and in Python,
 what works and what doesn't.
 
 Jamie

Jamie,
I have always been able to use the old version of pymssql.  But the issue has 
been the updated version - which did not work.  That said I have never liked 
pymssql because Ed had to make modification to the code that I did not really 
understand.  Of course the I did not really make an effort to understand why 
the mods were required because they just worked.

But now I have itch that needs scratching and will look deeper into the 
problems.  I will also take a look at the ODBC solution - now that Malcolm has 
pointed us in the right direction.  

I don't plan to really start for two weeks when I tackle moving AccountMate 
(FoxPro) MsSQL data to Postgres.  I'll need a solid MsSQL interface to get it 
done.  So I'm torn between doing something for Dabo (ODBC) and getting my work 
done.

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/201107130909.53295.jo...@jfcomputer.com


Re: [dabo-users] What is the dbMsSql status

2011-07-13 Thread John Fabiani
On Wednesday, July 13, 2011 10:27:03 am Paul McNett wrote:
 On 7/13/11 9:09 AM, John Fabiani wrote:
  I don't plan to really start for two weeks when I tackle moving
  AccountMate (FoxPro) MsSQL data to Postgres.  I'll need a solid MsSQL
  interface to get it done.  So I'm torn between doing something for Dabo
  (ODBC) and getting my work done.
 
 Sounds like you don't really need MSSQL from Dabo, you need to:
 
 1) export from MSSQL
 2) import into Postgres
 3) access Postgres from Dabo
 
 Paul

I wish that was the case.  It will be much easier to manipulate the MsSQL data 
if I use Dabo directly because I have to match an exist Postgres Database - 
xTuple Postbooks.  If you guys need a straight forward accounting package on 
Postgres you really should check xTuple Postbooks.  Not python (c++) but it 
has QT scripting built-in.  I've used the 'Postbooks' twice now and I like it 
very much.  They have a free version Postbooks, and Standard, Manufacturing, 
and Enterprise.  The last three of course cost $.

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/201107131038.17837.jo...@jfcomputer.com


[dabo-users] What is the dbMsSql status

2011-07-12 Thread John Fabiani
Hi,
Looks like I will need to access MsSQL again.  I recall there were others who 
also had the need.  So I'm wondering if the current Dabo tools to access MsSQL 
are working?  If not what are the current issues.  Thanks for the help.

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/201107121511.36023.jo...@jfcomputer.com


Re: [dabo-users] What is the dbMsSql status

2011-07-12 Thread John Fabiani
On Tuesday, July 12, 2011 04:19:37 pm Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  Hi,
  Looks like I will need to access MsSQL again.  I recall there were others
  who also had the need.  So I'm wondering if the current Dabo tools to
  access MsSQL are working?  If not what are the current issues.  Thanks
  for the help.
 
 Hi.
 I have few patches I will publish today evening.
 AFIK, there is no driver for Python 2.7.
 I tried to compile but without success.

Thanks Jacek!
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/201107121623.31786.jo...@jfcomputer.com


Re: [dabo-users] What is the dbMsSql status

2011-07-12 Thread John Fabiani
On Tuesday, July 12, 2011 04:31:51 pm pyt...@bdurham.com wrote:
 Is there a possibility of using one of the Python ODBC modules?
 
 Malcolm

I'm sure there is one.  However, I wonder how cross platform an ODBC driver 
would be?

I know there is a type of setup for Linux but I don't know of anything for the 
Mac.  No I haven't googled it.

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/201107121720.53663.jo...@jfcomputer.com


[dabo-users] More strnage 2.7

2011-07-09 Thread John Fabiani
Hi,
I continue to get strange errors from 2.7. openSUSE 11.4, wxPython 2.8.11.0 
latest Dabo.

Here's a new one 
Traceback (most recent call last):
  File /home/johnf/dabo/dabo/ui/uiwx/dPageFrameMixin.py, line 47, in 
__onPageChanging
self.Pages[oldPageNum]._saveLastActiveControl()
AttributeError: 'InfoPanel' object has no attribute '_saveLastActiveControl'

The code associated:

class PageTabs(dabo.ui.dPageFrame):

def beforePageChange(self,old, new):
if self.Form.EditMode == True:
dabo.ui.dMessageBox.stop(parent = self.Form, message ='Please 
release edit mode before moving to the next tab.')
#self.Form.notifyUser(Please release edit mode before moving 
to the next tab)
return False

I believe beforePageChange is a hook method.  All I'm trying to do is prevent 
the user from moving to a new tab while in EditMode.

Of course I do NOT see this error in 2.6.5

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/201107091137.27154.jo...@jfcomputer.com


Re: [dabo-users] More strnage 2.7

2011-07-09 Thread John Fabiani
On Saturday, July 09, 2011 11:45:43 am Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  Hi,
  I continue to get strange errors from 2.7. openSUSE 11.4, wxPython
  2.8.11.0 latest Dabo.
  
  Here's a new one
  
  Traceback (most recent call last):
 File /home/johnf/dabo/dabo/ui/uiwx/dPageFrameMixin.py, line 47, in
  
  __onPageChanging
  
   self.Pages[oldPageNum]._saveLastActiveControl()
  
  AttributeError: 'InfoPanel' object has no attribute
  '_saveLastActiveControl'
 
 It's not related to the Python 2.7 but r6667.
 I didn't handle exceptions there, because I assumed, evidently wrong,
 that all frame pages inherit from dPage class.
 I will fix it.

You could be correct but then why don't I see the error using 2.6.5?

And thanks in advance for the fix.
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/201107091148.32486.jo...@jfcomputer.com


Re: [dabo-users] More strnage 2.7

2011-07-09 Thread John Fabiani
On Saturday, July 09, 2011 11:48:32 am John Fabiani wrote:
 On Saturday, July 09, 2011 11:45:43 am Jacek Kałucki wrote:
  Użytkownik John Fabiani napisał:
   Hi,
   I continue to get strange errors from 2.7. openSUSE 11.4, wxPython
   2.8.11.0 latest Dabo.
   
   Here's a new one
   
   Traceback (most recent call last):
  File /home/johnf/dabo/dabo/ui/uiwx/dPageFrameMixin.py, line 47, in
   
   __onPageChanging
   
self.Pages[oldPageNum]._saveLastActiveControl()
   
   AttributeError: 'InfoPanel' object has no attribute
   '_saveLastActiveControl'
  
  It's not related to the Python 2.7 but r6667.
  I didn't handle exceptions there, because I assumed, evidently wrong,
  that all frame pages inherit from dPage class.
  I will fix it.
 
 You could be correct but then why don't I see the error using 2.6.5?
 
 And thanks in advance for the fix.
 Johnf

Now I see 
2011-07-09 12:05:56 - ERROR - The 'PageTabs' control must inherit from dPage 
to use the UseSmartFocus feature.

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/201107091207.15668.jo...@jfcomputer.com


Re: [dabo-users] More strnage 2.7

2011-07-09 Thread John Fabiani
On Saturday, July 09, 2011 12:06:03 pm Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  You could be correct but then why don't I see the error using 2.6.5?
  
  And thanks in advance for the fix.
 
 Fixed in r6689.
 Maybe you have UseSmartFocus set to False on 2.6?
 I just switched to the 2.7 branch and have no problems with it.
What is UseSartFocus I don't see it in Dabo?
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/201107091211.01231.jo...@jfcomputer.com


Re: [dabo-users] More strnage 2.7

2011-07-09 Thread John Fabiani
On Saturday, July 09, 2011 12:19:38 pm Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  What is UseSartFocus I don't see it in Dabo?
 
 It's very strange if you don't know what it is,
 because it's set by default to False.
 So, there shouldn't be any exception at all.

I have since discovered it.  And of course your changes include this new 
property.  But if it's default is False why am I seeing it.

Trying to debug as I type.  But I see your code being access many times.
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/201107091227.03592.jo...@jfcomputer.com


Re: [dabo-users] More strnage 2.7

2011-07-09 Thread John Fabiani
On Saturday, July 09, 2011 12:25:26 pm Jacek Kałucki wrote:
 Użytkownik John Fabiani napisał:
  Now I see
  2011-07-09 12:05:56 - ERROR - The 'PageTabs' control must inherit from
  dPage to use the UseSmartFocus feature.
 
 Now I see. I missed something, should be fine after r6691.
 Thanks John.


Looks good now.  BTW what does UseSmartFocus do?
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/201107091236.22993.jo...@jfcomputer.com


[dabo-users] water marks

2011-07-06 Thread John Fabiani
Hi,
Does anyone know how to add a water mark to a report?

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/201107061026.46747.jo...@jfcomputer.com


Re: [dabo-users] water marks

2011-07-06 Thread John Fabiani
On Wednesday, July 06, 2011 10:37:32 am Paul McNett wrote:
 PageBackground
Oh thanks
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/201107061039.50556.jo...@jfcomputer.com


Re: [dabo-users] water marks

2011-07-06 Thread John Fabiani
On Wednesday, July 06, 2011 10:39:50 am John Fabiani wrote:
 On Wednesday, July 06, 2011 10:37:32 am Paul McNett wrote:
  PageBackground
 
 Oh thanks
 Johnf

I'm getting the string 'xpr error' printed
Does that mean reportwriter can't find the pic?

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/201107061227.22277.jo...@jfcomputer.com


Re: [dabo-users] water marks

2011-07-06 Thread John Fabiani
On Wednesday, July 06, 2011 12:58:28 pm Nate Lowrie wrote:
 On 7/6/11 3:27 PM, John Fabiani wrote:
  On Wednesday, July 06, 2011 10:39:50 am John Fabiani wrote:
  On Wednesday, July 06, 2011 10:37:32 am Paul McNett wrote:
  PageBackground
  
  Oh thanks
  Johnf
  
  I'm getting the string 'xpr error' printed
  Does that mean reportwriter can't find the pic?
 
 Normally that's what it means.  Did you place it in the resources folder?
 
 Regards,
 
 Nate
 

When I move the jpg to ./resources the reportDesigner does not see it.  But if 
I move it to the root of the project it is seen by both Designer and 
ghostscript.

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/201107061357.43480.jo...@jfcomputer.com


Re: [dabo-users] Question: Calling a textbox field from the Bizobj

2011-07-01 Thread John Fabiani
On Thursday, June 30, 2011 06:41:20 am Ruffy Collado wrote:
 Hello, I have got a few questions and this may end up very long so sorry.
 
 
 
 I came from the Web Application development style using PHP, a few console
 programming in C but never had a full blown GUI Desktop application
 experience. I can now fairly see the difference in both development.
 
 I admire the work and elegance of Dabo, the style, the ideas are very well
 engineered. That's why even for a complete newbie in Python, let alone
 Desktop Applications, I chose this Framework.
 
 
 
 Enough with the admiration and on to the questions,
 
 
 
 1.Example I have a password field connected to the datasource and
 datafield in a MySQL table. I also have another field which is a confirm
 password, this one is of course no connected to the datasource. On the
 OnHit method of a button, I called in the self.Form.save(). I did some
 validations on empty fields and it works just like in the tutorial. But I
 never got the way to compare if the two password fields match each other
 using the validateRecord() Method of the Bizobj. By the way, I was
 following the Create application from start tutorial using my own tables.
 So, how can I get the value of the confirm password textbox using the
 bizobj? Should I create another method to validate it, using the Form as
 the caller of a Bizobj method passing the two textboxes values as
 parameters? Or should I just use the self.Application.ui way?
 
 
 
 2.In CodeIgniter a PHP MVC Web Framework, I use the Model to handle
 all the queries, I write my input and output queries in methods like
 add_new_user(data) and get_selected_members(data). Then this methods pass
 the result of the query or the dataset back to the Controller. That way
 when some SQL guy decides to change my queries for optimization, he can
 play with it while I do the business logic. Is there anyway to this in
 Dabo? I was thinking of using the db Folder as the storage for my Model
 Classes. Oh and I would also like to write my own SQL queries rather than
 the alchemy stuffs.
 
 
 
 3.Lastly, for now. Let's say have a table which has a ID, Name,
 Address, Image and Status as fields. Of course I wouldn't show my ID but
 dabo already takes care of this. I would also not show my status field
 cause I update them according to events or user choices. How can I do that
 in the bizobjs? When I call self.Form.save() I won't be able to access it
 through the self.Record.Status cause it is not in the form. Should I use a
 query in the validateRecord to fetch the chosen user? Or could I still
 access the self.Record.Status without it being included in my Form?
 
 
 
 Sorry for the long questions. It may be the most pointless one in the whole
 mail list. I just wanted to clarify these things, it really gets confusing
 when coming from a web app background and a web MVC architecture.
 
 
 
 I use Windows Xp, Python 2.7, Dabo 0.9.3, wxPython 2.8.

When you need to retrieve a value from a control (such as a dTextBox) you can 
use the RegID property.  RegID is used as an identifier. So in the case of 
your passwords you can check to see if the passwords match by:

self.Form.passwd1.Value == self.Form.passwd2.Value

where passwd1 and passwd2 are RegID properties of the controls.

Where you do the validation depends on you.  You can validate in the bizobj, 
or in one of the many hooks (beforeSave, Save), or maybe use an event trigger 
(dEvents.LostFocus).

Dabo's model is the bizobj's.  Somewhere in your code there is a definition 
of your table in the form of a Bizobj Class.  The  Bizobj Class contains 
the name of the table, the names of fields, the name of the primary key,  and 
optional joins, order by, group by.  You can even have virtual fields and 
default values.  But the bizobj class is not limited to just those things.  
Almost anything that you can do in standard SQL can be done in the Bizobj 
Class.  

If you need to write an ad hoc SQL query Dabo's temporary cursor is the tool I 
use.

tempCur = self.Form.PrimaryBizObj.getTempCursor()

tempCur.execute(Select * from someTable where pk = %s % 
(self.Form.RegID.Value))
Please review SQL injections before using the above,

The last question:

If the value you need is not on the form nor in a bizobj field then you will 
need to retrieve it from some table.  Use the temp cursor to retrieve it.  
Better would be that you add the information in a bizobj or make it a value in 
the form.  

self.Form.User = someStrValue  

Then use the self.User in the save routine.

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/201107010747.27550.jo...@jfcomputer.com


[dabo-users] evt.EventObject not seeing new value

2011-06-29 Thread John Fabiani
Hi,

Lastest Dabo, Python 2.6.5, wxPython 2.8.11, openSUSE 11.3 (also happens on 
windows).

I have a panel that is added to a panel - then both are added to a form.

So I have self.Parent.Parent.control (dDateTextBox)

I have the LostFocus event bound to the control.  

The problem is - the value that is in evt.EventData when LostFocus is 
triggered is the old value and not the value displayed on the screen in the 
control.  

I have never seen this in the past.  But from what I can determine it does not 
matter what event I use - the value is always the old value.  

This is SWAG:
The method/function I'm calling is called several times from the triggering of 
the evt and at some point in the calls the evt.EventData becomes valid.  I'm 
wondering if the event needs to be set at some different level.


What I'm doing:
I have two dates a from and a to.  The from date has to be less than the 
to date.  But I can't depend on the lostfocus of the to date to be the 
date just entered by the user.  So how can get this to work.

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/201106290843.22640.jo...@jfcomputer.com


Re: [dabo-users] evt.EventObject not seeing new value

2011-06-29 Thread John Fabiani
On Wednesday, June 29, 2011 08:43:22 am John Fabiani wrote:
 Hi,
 
 Lastest Dabo, Python 2.6.5, wxPython 2.8.11, openSUSE 11.3 (also happens on
 windows).
 
 I have a panel that is added to a panel - then both are added to a form.
 
 So I have self.Parent.Parent.control (dDateTextBox)
 
 I have the LostFocus event bound to the control.
 
 The problem is - the value that is in evt.EventData when LostFocus is
 triggered is the old value and not the value displayed on the screen in the
 control.
 
 I have never seen this in the past.  But from what I can determine it does
 not matter what event I use - the value is always the old value.
 
 This is SWAG:
 The method/function I'm calling is called several times from the triggering
 of the evt and at some point in the calls the evt.EventData becomes valid.
  I'm wondering if the event needs to be set at some different level.
 
 
 What I'm doing:
 I have two dates a from and a to.  The from date has to be less than
 the to date.  But I can't depend on the lostfocus of the to date to be
 the date just entered by the user.  So how can get this to work.
 
 Johnf

Below does work.  
self.oRangeFrom.Bind(wx.EVT_KILL_FOCUS, self.ValidFromRange)

I'm not sure why switching to the wx event works but it appears to work where 
as
self.oRangeFrom.bindEvent(dEvents.LostFocus, self.ValidFromRange)
do not.

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/201106291045.01678.jo...@jfcomputer.com


Re: [dabo-users] bizobj question

2011-06-28 Thread John Fabiani
On Tuesday, June 28, 2011 01:19:27 pm Paul McNett wrote:
 My dApp subclass handles getting the connection, and saves it to an
 attribute of the  App 'dbConnection'. Then when I instantiate a bizobj it
 is just 'self.bizOrders = Orders(self.Application.dbConnection)'.
 
 Paul

How does this help?

You have a subclass of dApp (unless you meant an instance of dApp).
You have a global.

If you just used the MainForm.createBizobj() wouldn't you have almost the same 
thing?

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/201106281353.09769.jo...@jfcomputer.com


Re: [dabo-users] bizobj question

2011-06-28 Thread John Fabiani
On Tuesday, June 28, 2011 02:14:18 pm Paul McNett wrote:
 On 6/28/11 1:53 PM, John Fabiani wrote:
  On Tuesday, June 28, 2011 01:19:27 pm Paul McNett wrote:
My dApp subclass handles getting the connection, and saves it to an
attribute of the  App 'dbConnection'. Then when I instantiate a
bizobj it is just 'self.bizOrders =
Orders(self.Application.dbConnection)'.
  
  How does this help?
 
 Nate was asking how to get the connection object from which to instantiate
 the child bizobj. I told him how I do it. I certainly hope it helps!
 
  You have a subclass of dApp (unless you meant an instance of dApp).
 
 I have a subclass of dApp, that when instantiated sets the dbConnection
 attribute.
 
  You have a global.
 
 Define global. Not sure of the relevance...
 
  If you just used the MainForm.createBizobj() wouldn't you have almost the
  same thing?
 
 The only difference being that the form creates the parent bizobj, but the
 children are created by instantiating the parent bizobj. So instead of:
 
 class MyForm(dForm):
def createBizobjs(self):
  parent = self.addBizobj(BizParent(connection))
  child1 = parent.addChild(BizChild1(connection))
  child2 = parent.addChild(BizChild2(connection))
  grandchild_of_child1 = child1.addChild(...)
  ...
 
 You define the children in the bizobjs themselves, so that whenever you
 instantiate a given bizobj you already have the child relationships in
 place. The form just knows about whatever parent bizobj to instantiate
 so the above becomes:
 
 class MyForm(dForm):
def createBizobjs(self):
  self.addBizobj(BizParent(connection))
 
 The end result is of course the same, you just encapsulate the code better
 IMO.
 
 Paul

By global I mean that the connect instance is available everywhere from 
anywhere.  The way you are using it.  Where as if the connection was created 
in createBizobj it is only used in the MainForm method.

Of course self.Application is still available to retrieve the connection.

I like the flexibility of the first method where I can create generic bizobj's 
classes and use them differently by attaching children as required by each 
form.  IOW's one form might require a different set of children from another 
form.  The relationships between a parent and different children may not be 
static or not required for form.

In Nate's case, it appears to be a straight forward parent child.  In my case 
an enrollment has different relationships.  I guess I could setup a permanent 
relationship but of course then I'd have the over head of the opening tables 
not needed.

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/201106281433.00713.jo...@jfcomputer.com


Re: [dabo-users] bizobj question

2011-06-28 Thread John Fabiani
On Tuesday, June 28, 2011 02:43:00 pm Paul McNett wrote:
 On 6/28/11 2:33 PM, John Fabiani wrote:
  By global I mean that the connect instance is available everywhere from
  anywhere.  The way you are using it.  Where as if the connection was
  created in createBizobj it is only used in the MainForm method.
 
 True, the application object is available from anywhere, which makes it a
 good place to store the connection instance.
 
  Of course self.Application is still available to retrieve the connection.
  
  I like the flexibility of the first method where I can create generic
  bizobj's classes and use them differently by attaching children as
  required by each form.  IOW's one form might require a different set of
  children from another form.  The relationships between a parent and
  different children may not be static or not required for form.
 
 Should it be the form that describes the bizobj parent:child relationship?
 I have different needs in different contexts, too, so I have different
 subclasses of my bizobjs defined in the biz layer.
 
  In Nate's case, it appears to be a straight forward parent child.  In my
  case an enrollment has different relationships.  I guess I could setup a
  permanent relationship but of course then I'd have the over head of the
  opening tables not needed.
 
 Yes, there are cases where you don't want all the baggage of moving to the
 next order to requery the children, the childrens' children, etc. But you
 can achieve that and still keep the biz relationship code out of the UI...
 
 Paul
 

It sounds like we are splitting hairs.  You still create the instance of the 
bizobj which in turn sets up the relationships.  

But I do see the merit of moving the setup of the relationships (the 
description into the bizobj) away from the UI code.  Yet I still have a 
negative response to creating globals in general. 

So I see the advantage but I also see the negative.  

I'm old school and think of getters and setters rather than globals.  However, 
in today's thinking most programmers feel it's OK to break the rule.

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/201106281459.38758.jo...@jfcomputer.com


Re: [dabo-users] bizobj question

2011-06-28 Thread John Fabiani
On Tuesday, June 28, 2011 03:07:46 pm Paul McNett wrote:
 What is negative about storing the connection in the application instance?

Right not much - in fact it's really already there.

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/201106281522.50483.jo...@jfcomputer.com


[dabo-users] set focus to a cell of a grid

2011-06-18 Thread John Fabiani
Hi,
I guess I'm being dumb here (not the first time) but how can I set the (or 
change) the focus from one cell to another cell in response to an event.

I'm using a grid as a way to edit values.  In one column I have a bool 
(checkbox) and I want the focus to move a different column when the value 
changes (bool == true).

IOW's I need a way to change the selection from one cell to a different cell 
programmatically.

Thanks in advance,
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/201106180819.47359.jo...@jfcomputer.com


Re: [dabo-users] bool grid column event

2011-06-18 Thread John Fabiani
On Thursday, June 16, 2011 06:10:09 pm John Fabiani wrote:
 Hi,
 Is there a simple way to determine a bool column (a checkbox) change ?
 Something like an event that will trigger a function.  Maybe some example
 code?
 
 Johnf

I am sub-classing dGrid and using the afterCellEdit hook to change a value.  
But it would be better if I could discover a way to trigger an event from the 
bool.  

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/201106180825.03018.jo...@jfcomputer.com


Re: [dabo-users] set focus to a cell of a grid

2011-06-18 Thread John Fabiani
On Saturday, June 18, 2011 08:19:47 am John Fabiani wrote:
 Hi,
 I guess I'm being dumb here (not the first time) but how can I set the (or
 change) the focus from one cell to another cell in response to an event.
 
 I'm using a grid as a way to edit values.  In one column I have a bool
 (checkbox) and I want the focus to move a different column when the value
 changes (bool == true).
 
 IOW's I need a way to change the selection from one cell to a different
 cell programmatically.
 
 Thanks in advance,
 Johnf
 ___

The only thing I could find that worked was
grid.MoveCursorRight(False) 

So I'm using the MoveCursor(Left or Right) to set the focus.

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/201106180926.04121.jo...@jfcomputer.com


Re: [dabo-users] bool grid column event

2011-06-17 Thread John Fabiani
On Thursday, June 16, 2011 06:32:31 pm Paul McNett wrote:
 On 6/16/11 6:10 PM, John Fabiani wrote:
  Is there a simple way to determine a bool column (a checkbox) change ?
  Something like an event that will trigger a function.  Maybe some example
  code?
 
 I see that dEvents.GridCellEdited isn't raised when a column is edited with
 the bool cell editor (please add a ticket).
 
 However, if the column is attached to a bizobj (DataField) then you could
 detect it at the bizobj level by overriding the hook method
 biz.afterSetFieldVal().
 
 Paul

Done !  And thanks for confirming.  I can't use the work around because the 
bool column is not a real data field.  I'm using a grid to replace a checklist 
because one of the columns requires editing.

I'll check into making the field.

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/201106170717.21541.jo...@jfcomputer.com


[dabo-users] bool grid column event

2011-06-16 Thread John Fabiani
Hi,
Is there a simple way to determine a bool column (a checkbox) change ?  
Something like an event that will trigger a function.  Maybe some example 
code?

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/201106161810.09789.jo...@jfcomputer.com


[dabo-users] diff between self.Record[] and self. in Report

2011-06-09 Thread John Fabiani
Hi,
Is there a difference between 
self.Record['course_pay_sched'] and self.course_pay_sched in the report 
writer  Even if they both work which is the proper one to use?

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/201106090626.53122.jo...@jfcomputer.com


Re: [dabo-users] diff between self.Record[] and self. in Report

2011-06-09 Thread John Fabiani
On Thursday, June 09, 2011 09:25:53 am Paul McNett wrote:
 On 6/9/11 6:26 AM, John Fabiani wrote:
  Is there a difference between
  self.Record['course_pay_sched'] and self.course_pay_sched in the report
  writer  Even if they both work which is the proper one to use?
 
 self.Record['s'] is more explicit, self.s is more implicit and easier
 to write. The latter will look first at self.Variables['s'] and only if
 a variable of that name doesn't exist, will then look at self.Records.
 
 I should really make a self.Record.s interface which would match with
 biz.Record.
 
 Paul

Thanks that helps explain an issue I had with (implicit) self.s.  I will try 
to remember the next time (also keep different variable names).

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/201106090931.08042.jo...@jfcomputer.com


[dabo-users] a spinner in a grid cell

2011-06-07 Thread John Fabiani
Hi,
I wonder has anyone placed a spinner into a cell of a grid.  I believe it 
would take a special col.CustomEditorClass.  Before I start this - I was 
wondering if anyone had already done it.  Maybe provide some hints or code.

Thanks in advance,

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/201106071148.32614.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-16 Thread John Fabiani
On Monday, May 16, 2011 08:03:49 am Ricardo Aráoz wrote:
 select top 1 a, b, c ,d, ..., z
 where a is not null, b is not null,  , z is not null
 
 
 If there is at least one record where no field is null this should work

Yes I thought of that.  But it does depend on a value being in the field else 
text is the data type.   Also the dataset size could be large and being 
recursive could cause issues with memory.  A better solution but not complete 
for the edge cases.

Adrian and I have been discussing the issue off line.  We decided the best way 
was for the developer to supply either hints (select fieldname '[date]', ...) 
or change dDataSet to accept a DataSource (the structure of the dataset) as a 
parameter.

Adrian may provide some code to deal with the issue in the near future. 

BTW  a big thanks to everyone that tried to help!

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/201105160914.11383.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-16 Thread John Fabiani
On Monday, May 16, 2011 10:39:36 am Paul McNett wrote:
 On 5/16/11 9:14 AM, John Fabiani wrote:
  Adrian and I have been discussing the issue off line.  We decided the
  best way was for the developer to supply either hints (select fieldname
  '[date]', ...) or change dDataSet to accept a DataSource (the structure
  of the dataset) as a parameter.
 
 You keep saying DataSource when I think you mean DataStructure.
 
 Paul

Yes you are correct - Sorry about that!
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/201105161104.11196.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-13 Thread John Fabiani
On Thursday, May 12, 2011 01:21:42 pm K Peters wrote:
 On Thu, May 12, 2011 at 12:00 PM, John Fabiani jo...@jfcomputer.com wrote:
  Hi,
  
  If I do something like the following a datatype is changed from date to
  string depending on the first record of the dataset.
  
  fields:
  mustenrollby = date
  referral = date
  
  first record
  mustenrollby = Null
  referral = '2011-04-10'::date
  
  second record
  mustenrollby = '2011-04-24'::date
  referral = '2011-04-10'::date
  
  aliasDict = {bd:dsBalanceDue} # contains only 3 fields not mustenrollby
 dsNew = ds.execute(select dataset.*, bd.course_cost as
  bd_course_cost, bd.paid_amt as bd_paid_amt
 from dataset join bd on dataset.enrollid = bd.enrolleeid order by
  dataset.lname, cursorDict=aliasDict)
  
  after executing the above the data type for the second record -
  mustenrollby is now a string.
  
  or u'2011-04-24'
  
  If the first record contains a real date the change does not happen???
  
  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/201105121200.46068.jo...@jfcomputer.com
 
 John,
 
 SQLite is *very* different from other SQL databases in that it uses
 manifest typing
 (see http://sqlite.org/different.html) which can cause the effects you
 have been observing;
 I would assume that Dabo takes whatever SQLite reports as data type
 for fields and it goes from there.
 
 Cheers,
 Kai

From what I have been reading I would agree.  However, in this case the 
datatype actually changes.  And the fact that it changes is dependent on the 
contents of the first record in the dataset I'm working with.  If the first 
record contains a Null the Dabo routine returns a text (string) - if it's a 
date it returns dates.  

This was completely unexpected and I believe it's a Dabo bug.  I'm not sure 
how to fix it but it needs fixing.

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/201105130630.50848.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-13 Thread John Fabiani

   
   John,
   
   SQLite is *very* different from other SQL databases in that it uses
   manifest typing
   (see http://sqlite.org/different.html) which can cause the effects you
   have been observing;
   I would assume that Dabo takes whatever SQLite reports as data type
   for fields and it goes from there.
   
   Cheers,
   Kai
  
  From what I have been reading I would agree.  However, in this case the
  datatype actually changes.  And the fact that it changes is dependent on
  the contents of the first record in the dataset I'm working with.  If the
  first record contains a Null the Dabo routine returns a text (string) -
  if it's a date it returns dates.
 
 By default Sqlite treats all fields as strings. The presence of a Null
 seems to invoke the default behavior.  You might want to give it a hint.
 So something like:
 
 first record
 mustenrollby = Null ::date
 referral = '2011-04-10'::date
 
  This was completely unexpected and I believe it's a Dabo bug.  I'm not
  sure how to fix it but it needs fixing.
  
  Johnf

I have tried to do exactly that without success.  Also you can not ALTER 
Column.

The way I discovered the issue came from the fact I needed to combine 
different Postgres database data (IOW's not in the same domain).  So I decided 
to use two different connections (very cool feature of Dabo) and combine the 
information using datasets.  When I do a join of the datasets to produce a new 
dataset the datatypes of the fields can change due to the presents of a null 
in the field in the first record.  This came as a surprise.

So I have two datasets and the datatypes for the fields are correct - combine 
them using a join and the datatypes get changed.

Paul has discovered the cause - Dabo creates a new in memory table to store 
the data for the join (other actions cause the same thing).  In the Dabo 
routine dDataSet the routine must determine the datatype of each field - to 
create the table.  The way the Dabo routine makes that determination depends 
on the first record.  If by chance the field contains a Null the datatype 
becomes text.  If the data is a date then the datatype becomes a date.

I'm not talking about how the data is stored - I realize the data is stored as 
a string in either case.

I don't see how it can be fixed.  If the routine requires that a record be 
used to determine datatype then we are stuck with the results.  Even if you 
had the routine check 100 records they all could be null and the 101 record 
contain a date.  I didn't find any information_schema function for sqlite.  
And the suggestion on PRAGMA Paul said would not work.

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/201105130726.35237.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-13 Thread John Fabiani
On Friday, May 13, 2011 07:33:30 am Adrian Klaver wrote:
 Have Postgres return a dummy date whenever there is a NULL

Yes I thought of that too.  However, there is about 500 lines of code that is 
depending on the Null being present (the routine was depending on Postgres 
data at the start).  So then set the data with '1900-01-01'::date and then 
update the dataset with null where field = '1900-01-01' but that did not work.  

That was late yesterday - I may have done something wrong.

This is what I came up with and it works.

1. Do all the changes required to the dataset.
2. loop through the dataset
3. change the field data
4. save the record into a list
5. convert the list to a dataset


date_list = ('rereferred', 'datepaid','nxt_class','terminated', 
'completed','ret_to_court', 'hold_until', 'mustenrollby', 'me_ltr_sent', 
'enrolled','referred date')

ret_ds = []
for rec in d3: # d3 is a dataset
for item in date_list:
rec[item] = fixsqlitedate(rec[item])
ret_ds.append(rec)
newds_ordered = dDataSet(ret_ds)

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/201105130744.41468.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-13 Thread John Fabiani
On Friday, May 13, 2011 07:44:03 am Adrian Klaver wrote:
 On Friday, May 13, 2011 7:26:35 am John Fabiani wrote:
 John,
  
  I don't see how it can be fixed.  If the routine requires that a record
  be used to determine datatype then we are stuck with the results.  Even
  if you had the routine check 100 records they all could be null and the
  101 record contain a date.  I didn't find any information_schema
  function for sqlite. And the suggestion on PRAGMA Paul said would not
  work.
 
 I had another thought after my previous post. Create a dummy record that
 has all the fields filled with the appropriate data types. Include it in
 the initial dataset  to 'seed' the table creation process. Delete it from
 the dataset once the table is created.
 
  Johnf

On the surface that sounds good but I could not figure out how to do it in a 
dynamic way.  I ran into the same problem Dabo has.  How can I determine the 
datafields and provide the fake data for the first record.  

I also considered creating a DataSource for the dataset.  But the Dabo routine 
does not look at the DataSource description.

I could of course change the Dabo routine to look for a DataSource description 
and use it if it was available.  But to be honest I consider my solution a 
hack!

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/201105130753.40751.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-13 Thread John Fabiani
On Friday, May 13, 2011 08:08:19 am Adrian Klaver wrote:
  On the surface that sounds good but I could not figure out how to do it
  in a dynamic way.  I ran into the same problem Dabo has.  How can I
  determine the datafields and provide the fake data for the first record.
 
 You say you are pulling the data from Postgres.  psycopg2 captures the
 fields and  type info in cursor.description. As to fake data:
 
 select id::int, '1901-01-01::date', 'test'::varchar;
 
 Use to create table/dataset and then insert rest of data into dataset?
 
 Got to run, will ponder further.


COOL!!!  Never considered using the Postgres info.  Not completely sure how at 
the moment but I do know a DataSource description is available for each of the 
database engines Dabo supports.  

H  I'll have to think about this.

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/201105130815.27865.jo...@jfcomputer.com


[dabo-users] dataset/sqlite changes the data type

2011-05-12 Thread John Fabiani
Hi,

If I do something like the following a datatype is changed from date to string 
depending on the first record of the dataset.

fields:
mustenrollby = date
referral = date

first record
mustenrollby = Null
referral = '2011-04-10'::date

second record
mustenrollby = '2011-04-24'::date
referral = '2011-04-10'::date

aliasDict = {bd:dsBalanceDue} # contains only 3 fields not mustenrollby
dsNew = ds.execute(select dataset.*, bd.course_cost as bd_course_cost, 
bd.paid_amt as bd_paid_amt
from dataset join bd on dataset.enrollid = bd.enrolleeid order by 
dataset.lname, cursorDict=aliasDict)

after executing the above the data type for the second record - mustenrollby 
is now a string.

or u'2011-04-24'

If the first record contains a real date the change does not happen???

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/201105121200.46068.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-12 Thread John Fabiani
On Thursday, May 12, 2011 01:23:28 pm Paul McNett wrote:
 On 5/12/11 1:03 PM, Paul McNett wrote:
  Set DataStructure explicitly.
 
 Oops, you are talking about datasets not cursors. dDataSet uses a different
 method to track types. Try this patch and post the output to see if my
 hunch is correct (function assumes that the types of the first record are
 the types of the remaining records, but doesn't handle NULL/None):
 
 Index: dDataSet.py
 ===
 --- dDataSet.py   (revision 6589)
 +++ dDataSet.py   (working copy)
 @@ -281,7 +281,9 @@
   retList.append(%s %s % (safekey, 
 ds._typeDict[typ]))
   except KeyError:
   retList.append(safekey)
 - return create table %s (%s) % (alias, , .join(retList))
 + ret = create table %s (%s) % (alias, , .join(retList))
 + print ret
 + return ret
 
 
   def _populate(self, ds, alias=None):
 
 
 Paul

Below is the output - 
Why are some of the fields datatypes are noted but others are not?  And of 
course the mustenrollby has no datatype?


create table dataset (sqlstmt text, sql_limit text, pkid integer, lk_filter, 
tablename text, datatype text, colcount integer, txtboxid, hlist text, 
lookupfld text, regid text, sql_orderby text, prikey text, retfield text)
create table dataset (abbrev text, depart integer, restitution_tobedeter, 
comsvcworked decimal, course_pay_sched text, clientid integer, topic text, 
yntbd text, rereferred, inactive, enrollid integer, state_1 text, paid_amt 
decimal, clientname text, hrs_attended, topicid, datepaid date, agency text, 
dej, caseno text, lname text, restitution_paid decimal, program text, 
nxt_class date, missed_cnt integer, status text, community_tobedeter, fname 
text, ccode text, terminated, completed, paid decimal, loc2 text, phone text, 
loc1 text, hrs_req integer, comsvcreq integer, rest_amt decimal, course_cost 
decimal, ret_to_court date, agencyid integer, language text, loc3 text, 
hold_until, ref_no text, programid integer, mustenrollby, me_ltr_sent, 
enrolled date, referred date)
create table bd (paid_amt decimal, course_cost decimal, enrolleeid text)

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/201105121416.41367.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-12 Thread John Fabiani
On Thursday, May 12, 2011 02:16:41 pm John Fabiani wrote:
 On Thursday, May 12, 2011 01:23:28 pm Paul McNett wrote:
  On 5/12/11 1:03 PM, Paul McNett wrote:
   Set DataStructure explicitly.
  
  Oops, you are talking about datasets not cursors. dDataSet uses a
  different method to track types. Try this patch and post the output to
  see if my hunch is correct (function assumes that the types of the first
  record are the types of the remaining records, but doesn't handle
  NULL/None):
  
  Index: dDataSet.py
  ===
  --- dDataSet.py (revision 6589)
  +++ dDataSet.py (working copy)
  @@ -281,7 +281,9 @@
  
  retList.append(%s %s % (safekey, 
ds._typeDict[typ]))
  
  except KeyError:
  retList.append(safekey)
  
  -   return create table %s (%s) % (alias, , .join(retList))
  +   ret = create table %s (%s) % (alias, , .join(retList))
  +   print ret
  +   return ret
  
  def _populate(self, ds, alias=None):
  Paul
 
 Below is the output -
 Why are some of the fields datatypes are noted but others are not?  And of
 course the mustenrollby has no datatype?
 
 
 create table dataset (sqlstmt text, sql_limit text, pkid integer,
 lk_filter, tablename text, datatype text, colcount integer, txtboxid,
 hlist text, lookupfld text, regid text, sql_orderby text, prikey text,
 retfield text) create table dataset (abbrev text, depart integer,
 restitution_tobedeter, comsvcworked decimal, course_pay_sched text,
 clientid integer, topic text, yntbd text, rereferred, inactive, enrollid
 integer, state_1 text, paid_amt decimal, clientname text, hrs_attended,
 topicid, datepaid date, agency text, dej, caseno text, lname text,
 restitution_paid decimal, program text, nxt_class date, missed_cnt
 integer, status text, community_tobedeter, fname text, ccode text,
 terminated, completed, paid decimal, loc2 text, phone text, loc1 text,
 hrs_req integer, comsvcreq integer, rest_amt decimal, course_cost decimal,
 ret_to_court date, agencyid integer, language text, loc3 text, hold_until,
 ref_no text, programid integer, mustenrollby, me_ltr_sent, enrolled date,
 referred date)
 create table bd (paid_amt decimal, course_cost decimal, enrolleeid text)
 
 Johnf

Would something like this work?

PRAGMA table_info(table-name);

Johnf


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
___
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/201105121459.44397.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-12 Thread John Fabiani
On Thursday, May 12, 2011 03:07:49 pm Paul McNett wrote:
  try:
 +   retList.append(%s %s % (safekey,
 ds._typeDict[self.Cursor._types[safekey]
 +   except (KeyError, AttributeError):
 +   retList.append(safekey)

That's a syntax error - 

should it be
retList.append(%s %s % (safekey, ds._typeDict[self.Cursor._types[safekey]]))
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/201105121523.46691.jo...@jfcomputer.com


Re: [dabo-users] dataset/sqlite changes the data type

2011-05-12 Thread John Fabiani
On Thursday, May 12, 2011 03:23:46 pm John Fabiani wrote:
 On Thursday, May 12, 2011 03:07:49 pm Paul McNett wrote:
   try:
  +   retList.append(%s %s %
  (safekey, ds._typeDict[self.Cursor._types[safekey]
  +   except (KeyError, AttributeError):
  +   retList.append(safekey)
 
 That's a syntax error -
 
 should it be
 retList.append(%s %s % (safekey,
 ds._typeDict[self.Cursor._types[safekey]])) Johnf

Using my changes 

It does not work!  I'm still changing a date field to a string.  I also can 
not figure out how to cast the field.

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/201105121533.38895.jo...@jfcomputer.com


[dabo-users] strange date change on windows

2011-05-10 Thread John Fabiani
Hi,

A client is reporting a change in the way the date is displayed.  I confirmed 
it.  Has anyone else seen this?

dabo.settings.dateFormat =%m/%d/%Y

 On windows suddenly I getting
6/7/2011'
and on Linux I still get
06/07/2011

Of course the display is using dDateTextBox for the control.

Both are using the same code and the latest Dabo.  Before I go chasing this 
does someone have a clue what could cause this change?

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/201105100655.30619.jo...@jfcomputer.com


Re: [dabo-users] strange date change on windows

2011-05-10 Thread John Fabiani
On Tuesday, May 10, 2011 10:04:20 am Paul McNett wrote:
 On 5/10/11 6:55 AM, John Fabiani wrote:
  Hi,
  
  A client is reporting a change in the way the date is displayed.  I
  confirmed it.  Has anyone else seen this?
  
  dabo.settings.dateFormat =%m/%d/%Y
  
On windows suddenly I getting
  
  6/7/2011'
  and on Linux I still get
  06/07/2011
 
 Setting dabo.settings.dateFormat sets it in the 'dabo.settings' namespace.
 However, it is the 'dabo' namespace that is referred to by all the date
 functions.
 
   import dabo
   print dabo.settings.dateFormat, dabo.dateFormat
 
 None None
 
   dabo.settings.dateFormat = %m/%d/%y
   print dabo.settings.dateFormat, dabo.dateFormat
 
 %m/%d/%y None
 
 So try setting dabo.dateFormat directly instead.
 
  Both are using the same code and the latest Dabo.  Before I go chasing
  this does someone have a clue what could cause this change?
 
 A while ago we standardized on using 'dabo.setting' instead of
 'dabo.settings.setting' in the dabo codebase.
 
 Paul


Well, thank you Paul - that was it.  
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/201105101020.07135.jo...@jfcomputer.com


Re: [dabo-users] Application set up - intelligence - Dabo book

2011-05-10 Thread John Fabiani
On Tuesday, May 10, 2011 10:24:13 am Stef Kariotidis wrote:
 Thank you all for your answers and the code, it sure is a good start to
 look.
 I also vote for a ready made UI component providing intelligence
 features if is possible.
 
 About a Dabo book - cookbook,
 Packt Publishing  (http://www.packtpub.com http://www.packtpub.com/),
 is a publishing company that has published many books around open source
 technologies, they also give some of their income from those books back
 to the open source projects
 (which means that Dabo could get some money back).
 At their books the introduce a feature for their customers to suggest
 books, more specifically/:
   If there is a book that you need and would like to see us publish,
 please send
 us a note in the SUGGEST A TITLE form on www. packtpub. com or e-mail
 suggest@packtpub. com. /,  taken from a published book.
 
 Is there a chance anytime in future to see a published book about Dabo?
 Please note that I am not
 affiliated with the Packt Publishing, just happens to be one of their
 customers who bought some books
 and after seeing the /suggest a book feature/ my first thought that
 came in mind was Dabo since it is the only
 Python framework for Rich Desktop Applications. IMHO it would be a great
 opportunity to promote Dabo and fund
 some of the project's needs.
 
 Kind regards,
 Stef K.

It sounds great.  But, there are only two guys really qualified to write the 
book and both are very busy.  Of course there is an incentive - that of course 
is being a published author.  In some circles that can be the difference 
between getting the job (new client?) and not.  And then there is the issue of 
the size of the audience - the Dabo community is not very large compared to 
other open source projects.  I would think packtpub would have to weight the 
investment vs the size of potential number of buyers.

But I do know that a book on designing a framework - would be well received in 
higher educational courses.  Living very close to a college I have had many 
discussions with instructors and such a book using a modern language would do 
well.

Also how would the money be spent?  

That said, I do recall that O'Reilly Books had small 10-25 page papers that 
they published (e-books?).  I bet a small 25 page article would help encourage 
others to review Dabo or the trade offs of a framework.

Side Note:
I have noted that Hank Fay (VFP'er) has been blogging about Dabo.



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/201105101049.35775.jo...@jfcomputer.com


Re: [dabo-users] Application set up - intelligence - Dabo book

2011-05-10 Thread John Fabiani
On Tuesday, May 10, 2011 11:18:58 am Paul McNett wrote:
 On 5/10/11 10:49 AM, John Fabiani wrote:
  I have noted that Hank Fay (VFP'er) has been blogging about Dabo.
 
 You mean this? :
 http://blog.prosysplus.com/2010/12/reset-tools-and-frameworks.html
 
 Paul

He has been interested in Dabo for a while.  He also has made references on 
UT.  

It's been a sad story for Hank (IMHO).  He really bought into the .Net thing 
and has suffered as a result.  First he quickly discovered that .Net did 
little to help his CRUD apps, then went for IronPython. 

At first he thought mono was going to be his cross platform solution - that 
did not go well.  BTW Mono might be a moot issue today with Novel laying off 
all the developers.  Then M$ drop direct support for IronPython.  So the only 
tech that is working for him has python.

He also is reviewing other tech (as all of do).  Right now is talking about 
Lianja - www.lianja.com.  I'm not sure how it works but looks like something 
we should all be aware.

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/201105101135.01030.jo...@jfcomputer.com


Re: [dabo-users] Application set up - intelligence

2011-05-09 Thread John Fabiani
On Monday, May 09, 2011 08:58:38 am Nate Lowrie wrote:
 On Sun, May 8, 2011 at 16:55, Stef Kariotidis st7fa...@hotmail.com wrote:
  Greetings to the list from a newbie and thanks for the creation of Dabo,
  
  This is my first time posting to the list so please bare with me
  considering the following questions...
  
  I would like to ask two things:
  
  1) I develop an application who monitors networked machines  and i use
  SQLite to save the state of the networked machines over time and some
  statistics. I also have some modules
  to handle the monitoring process and the logic of the app. My question
  is, where is the right place to put the logic of the application in
  respect to the Dabo application? I know that the database information
  (***. cnxml) goes to db directory and that the modules that handle the
  queries (bizobjs go to their directory (biz)).
  Where is the right place to put the database file (***.sqlite) and the
  rest of the python modules which are the logic of the application?
 
 I normally put the database file in the db folder as well.  You can
 put the python modules in the Lib folder (or at least that's what I
 do).
 
  2) I want to create a drop down box (combo box?) with intelligence
  enabled; more specifically as the user types in, the control searches
  data from a database table suggesting entries,
  after finding the correct entry the user presses enter  or tab to
  accept the value and goes on with the rest of data entry.
 
 I would actually use a dTextBox and extend it so that the key down
 event renders a search which triggers a pop-up menu with the
 suggestions.  The user can continue entering data or press the down
 arrow or tab to navigate into the pop-up menu and select an
 intelli-sense entry.  You may want to take a look at the dEditor code
 for how it does intelli-sense with the editor window.
 
 Regards,
 
 Nate

http://dabo.codepad.org/HmLoEc9O

The above is some code written years ago.  I can't recall how well it works 
but it's a starting point - 

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/201105090931.03178.jo...@jfcomputer.com


[dabo-users] multi-calls to callAfter

2011-05-06 Thread John Fabiani
Hi,

What happens when I make several calls to dabo.ui.callAfter(someFuction).  If 
I call the same function each time - do they queue up and then fire one at a 
time.  Or does the framework realize that the same function was called and 
fire it only one time???

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/201105060839.45653.jo...@jfcomputer.com


Re: [dabo-users] multi-calls to callAfter

2011-05-06 Thread John Fabiani
On Friday, May 06, 2011 08:44:02 am Ed Leafe wrote:
  callAfterInterval() is designed to catch identical calls that occur within
 the specified interval, and only make one call once the interval passes

Thanks that's what I needed to know.  I knew there was something out there 
that only fired once - just could not recall the details.  Again Thanks!

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/201105060846.59203.jo...@jfcomputer.com


Re: [dabo-users] update causing flashing

2011-05-04 Thread John Fabiani
On Tuesday, May 03, 2011 10:02:51 pm Paul McNett wrote:
 On May 3, 2011, at 20:37, John Fabiani jo...@jfcomputer.com wrote:
  Specifically, what is flashing? Viewing the PDF in your PDF viewer?
  If so,
  what PDF viewer are you using and what version? Looking at the
  report in
  the ReportDesigner? If so, yare you talking about the visual design
  surface?
  
  Paul
  
  Sorry Paul I could have done better explaining.  But to be honest I
  was
  wondering if others that the issue.  I have code that creates a
  dynamic form
  that import's the reportwriter and other classes.  I tried
  commenting out the
  import of the reportwriter and the flashing stopped
 
 You still didn't tell us what specifically is flashing. ;)
 
 Paul

Sorry again the form is flashing.  Today I'll try '#'ing out some of the code 
to see if I can find the root cause.
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/201105040620.47138.jo...@jfcomputer.com


[dabo-users] no refresh or update for scrollpanel?

2011-05-04 Thread John Fabiani
Hi,

I have need to create dynamic controls on a scroll panel.  But I can not 
update the display with new controls - they are not visable.

I have tried 
self.update()
self.refresh()

where self = the scroll panel

 

If I update the form containing the scroll panel the display is not updated.  
But this works
self.Form.Height += 1
self.Form.Height  -= 1

But this causes flashing!
Even adding 
lock() and unlock() do not prevent the flashing.

So the question is there a way to force the scroll panel to update the 
display.  Or does anyone have a better way to update the display.

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/201105040852.42843.jo...@jfcomputer.com


<    1   2   3   4   5   6   7   8   9   10   >