As this is getting very involved, I will try to limit the number of questions in
each post.

First,  I really appreciate all the help.

Second:

>> AppWizardX works well. But not with the Firebird database (a long list of
>> errors when trying to start the app created).

>Hmm, I don't use firebird so would you mind attaching the entire traceback?

My mistake: this was using multiple tables, with relationSpecs. However, using
the dabo Firebird db for the Customers table, after querying the db, and  moving
to the Browse page the following error is received:

Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'
Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'
Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'
Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'
Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'
Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'
Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'
Traceback (most recent call last):
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\eventMixin.p
y", line 88, in raiseEvent
    bindingFunction(event)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 83, in __onValueRefresh
    self.refresh()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\dDataControlM
ixinBase.py", line 114, in refresh
    self.Value = self.Source.getFieldVal(self.DataField)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1043, in getFieldVal
    return cursor.getFieldVal(fld, row)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\db\dCursorMixin.
py", line 546, in getFieldVal
    if rec.has_key(fld):
AttributeError: 'tuple' object has no attribute 'has_key'


Third:

>> I have also noticed that the app created does not update the database.

>Just in firebird?

Using the app created by AppWizardX with dabo Mysql db, after record is edited
and saved, on re-querying changes are not shown.

Fourth:

>> To get it running I've copied your PagEditClient.py as PagClientBalance.py.
>>What am I doing wrong?

>Don't create a new pageframe, use the PageFrame as already set up by the form.
>In the form's afterInit(), try this:

>self.PageFrame.appendPage(self.Application.ui.PagClientBalance, "Balance")

Thanks, it works now.  I added the previous line because I received an error
that PageFrame didn't exist.  I must have done something else wrong.

Fifth:

>I forgot to mention the other way to join tables, by setting a parent/child
>relationship among one or more bizobjs. Please ask and Ed or myself will go
>into detail on that...

Please could you do that.  Paul's explanation of overriding the base SQL was
very clear.


Sixth:
>> However, the following error occurs (both using your MySQL database for the
>> Orders table, and your Firebird database for the Customers table):

>The problem is that our default encoding in Dabo is utf8, but the encoding on
>those test tables is latin-1. Just explicitly set the encoding in the bizobj:

>def initProperties(self):
>...
>self.Encoding = "latin-1"

The above code added to initProperties of biz.Customer.py generated by
AppWizardX using the dabo MySql db produces the following error:

Traceback (most recent call last):
  File "C:\Python24\dabo\updates\051025\daboide\wizards\webtest\webtest.py", lin
e 29, in ?
    frm = ui.FrmCustomer()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\datanav\Form
.py", line 62, in __init__
    super(Form, self).__init__(parent, *args, **kwargs)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\uiwx\dForm.py
", line 57, in __init__
    fm.dFormMixin.__init__(self, preClass, parent, properties, *args, **kwargs)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\uiwx\dFormMix
in.py", line 49, in __init__
    super(dFormMixin, self).__init__(preClass, parent, properties, *args, **kwar
gs)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\uiwx\dPemMixi
n.py", line 132, in __init__
    self._afterInit()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\lib\datanav\Form
.py", line 69, in _afterInit
    super(Form, self)._afterInit()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\uiwx\dForm.py
", line 79, in _afterInit
    super(dForm, self)._afterInit()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\uiwx\dFormMix
in.py", line 84, in _afterInit
    super(dFormMixin, self)._afterInit()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\ui\uiwx\dPemMixi
n.py", line 202, in _afterInit
    self.afterInit()
  File "C:\Python24\dabo\updates\051025\daboide\wizards\webtest\ui\FrmCustomer.p
y", line 24, in afterInit
    primaryBizobj = app.biz.Customer(app.dbConnection)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 28, in __init__
    super(dBizobj, self).__init__(properties=properties, *args, **kwargs)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\dObject.py", lin
e 29, in __init__
    self._initProperties()
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\dObject.py", lin
e 104, in _initProperties
    self.initProperties()
  File "C:\Python24\dabo\updates\051025\daboide\wizards\webtest\biz\Customer.py"
, line 13, in initProperties
    self.Encoding = "latin-1"
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 134, in __setattr__
    super(dBizobj, self).__setattr__(att, val)
  File "c:\Python24\Lib\site-packages\Dabo-0.4.2-py2.4.egg\dabo\biz\dBizobj.py",
 line 1278, in _setEncoding
    self._CurrentCursor.Encoding = val
AttributeError: 'NoneType' object has no attribute 'Encoding'

Seventh:
>Perhaps in a later incarnation of the report writer, it will be able to handle
>linked cursors or bizobjs. But for now, it needs a single denormalized dataset.

This is perhaps my major concern at the moment.  In order for this to be at all
successful (or even used), I have to replace reports that are currently
being produced.

These reports all take results from two tables, and show daily results as well
as totals to date.  Table1 just returns a single record (based on date
selection).  No problem with that.  However Table2 returns multiple records,
that must be summarised in several ways (also selected by date).

For example:

dailyInfo1    dailyInfo2  dailyInfo3  etc (from Table1)

               stockTypeA  stockTypeB stockTypeC  Total
loadPortADaily     1          45         23         69
loadPortATotal     13         105        92         210  (all from Table2)

There may be several load ports (up to 5), as well many different stock types
(up to 70) that change every 30 days.

The number of loadPorts and stockTypes are known before the reports are to be
produced, but change far too frequently to be coded.

To produce this report I would normally make several sql calls:
1. select * from Table1 where date=2005/01/10
2. select stockType, info from Table2 where date=2005/01/10 and loadPort=X group
by stockType
(this would be run for each loadPort)
3. select sum(info) from Table2 where where date>=2005/01/01 and
date<=2005/01/10 and loadPort=X group by stockType
(this would be run for each loadPort)

Obviously this approach wouldn't work with Dabo, and denormalising all of this
into one table would be horrible.

What would be the best way of tackling this problem?


Many thanks.


Matthew.



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

Reply via email to