On 05/11/2013 08:42 AM, John Fabiani wrote:
On 05/09/2013 10:51 AM, Paul McNett wrote:
Sorry for top posting but I wanted to show you how easy it is to
regression test with git.
cd dabo (your git clone)
git pull
git checkout dabo-0.9.4
git bisect clear
git bisect start
git bisect good
git checkout v0.9.10
git bisect bad
Every time you say either bad or good git will checkout a commit on
between the current bad and good which you then run against and then
tell git either bad or good again. It'll take probably 7 iterations
to find the commit that broke it.
This was an adventure in patience battling my iPhone
autocorrect/autocapitalization of all those gits. I'm not sure if the
clear and start commands are strictly necessary.
When done note the commit and report back here.
Paul
On May 9, 2013, at 10:20, John Fabiani <[email protected]> wrote:
On 05/08/2013 03:59 PM, Paul McNett wrote:
On 5/7/13 4:39 PM, John Fabiani wrote:
I have a couple of grids that are NOT respecting several
properties and I wonder
anybody understands the reason.
I've created a small test for both scenarios and I'm not seeing the
described
behavior on Linux using my working copy of pre-0.9.10. I'll try to
find time to test
prior versions and different operating systems but in the meantime
please try this
code on your machine:
https://gist.github.com/anonymous/5544305
I've left the rest of your post below for reference but didn't
comment below this.
Paul
The Precision property is not displaying as I believe it should.
My code is for a
column.
col1 = dabo.ui.dColumn(self, Name="itemCost", Order=30,
DataField="aropen_amount",
Precision = 2, DataType="decimal",
Caption="Amount",
Sortable=False, Searchable=False,
Editable=True)
I would expect the column to display
300.00
But the column displays
300.0000
The bizobj reports the field as Decimal('300.0000')
The second issue I'm having is centering a value in a column;
col = dabo.ui.dColumn(self, Order=30, DataField="pkid",
DataType="int", Caption="Enrollment
#",
Sortable=False, Searchable=False,
Editable=False,
Expand=False, HorizontalAlignment = 'Center'
No matter what I set the HorizontalAlignment (either left,right,or
center) the value
is displayed as right aligned. I expected the value to be
centered if I asked for
centered. I've also attempted to change the DataType to 'str'
without success. The
bizobj field is an integer.
Thanks in advance for any help.
Johnf
Your code runs correctly. Even when I change the code to closely
match how I normally setup a form - it still works correctly. But
of course these are very simple forms. I was sort of sure that
might be the case because I haven't seen the problem in the past.
What I'm finding is some thing changes the Precision between
"afterInit" and "afterInitAll" in the mainform. Of course there is
lot happening on the panel that has the grid in question (RegID =
'inv_Grid'). I have tested the precision on the last line of code
for the panel and it's still correct. I tested it in many areas of
my code without any success in discovering where the precision is
getting changed. I also confirmed I was mistaken in my earlier
statement where I thought the problem occurred after the requery().
I do have a work around but I'm not pleased with what I did to get
it to work. I'd rather discover the root cause. In that effort I
have posted the code for the panel to git
https://gist.github.com/anonymous/90a16e223970febfe721
The panel (Class LineItemPanel) is added to the form as a tab using
"appendPage(pgCls=LineItemPanel, caption="Accounting")" other than
one place - it is not used anywhere else. The data associated with
the grid is a standard bizobj - but is a grand child of the
PrimaryBizobj.
To make matters worse the issue of precision does not occur in Dabo
0.9.4. I know this because the client is using the code. But I
have very little experence in revert git code. And I'm sure where to
start since git started after Dabo 0.9.5.
Johnf
I have yet reverted. But I did discover that if I change
"implicitPrecision" to False as the default for
"_setDataTypeFromDataField()" in dGrid. All works correctly.
I continued by removing the default of 'True' for
_setDataTypeFromDataField().
And discovered that in "_setRenderer()" you call the
"_setDataTypeFromDataField()" without setting "implicitPrecision"
value. If I set the "implicitPrecision" value to False all works
correctly again.
In the init you are setting the value as
if dataFieldSent and not dataTypeSent:
implicitPrecision = not precisionSent
Which if Precision is set the value of implicitPrecision = False
Which of course is correct.
But you are NOT setting the default value of "implicitPrecision" in
def _setRenderer(self):
self._setDataTypeFromDataField()
...
I'm do not know exactly why you did not set the value, but it is the
root cause of the my decimal problem not holding the Precision value.
Should it be set to False?
The data field in question date type is numeric(9,4) and the extra
digits are used to assist with rounding to the nearest penny. Also I
can not change the data type.
BTW the reason it was so hard to debug was the call is in
dabo.ui.callAfter(self._setDataTypeFromDataField)
which is difficult to trace.
Johnf
How about this for a change to the dGrid->dColumn->_setRenderer()
def _setRenderer(self):
if self.Precision:
implicitPrecision = False
else:
implicitPrecision = True
self._setDataTypeFromDataField(implicitPrecision)
This of course passes your code and my code.
Johnf
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]