El 13/09/13 09:21, Ricardo Aráoz escribió:
El 13/09/13 09:02, John Fabiani escribió:
On 09/13/2013 04:37 AM, Ricardo Aráoz wrote:
Thanks John.
In the for loop I'm just doing an addField() for every field
included in the data structure. Is this not needed? Is the data
structure enough?
Try removing it - if it works then you are OK. I don't normally take
the time to define a 'datastructure' - I just use .addField(). I
haven't run into any problems that I recall. My guess is I'm not the
right person to discuss this with - Paul, I believe uses
'datastructure' in his programming and if memory serves he does so to
avoid some sort of issue or maybe it's just something left over from
the past???
IMHO -
The guys that have been using Dabo for a long time are using coding
routines/behaviors that probably aren't required - they just don't
hurt and they work.
For example I started hand coding my forms/windows - mostly because
when I started the GUI designer wasn't very stable. A far as I know
it is very stable now. But I continue to hand code the forms. I see
code that others post and I see routines that I know didn't work and
I had to work around long ago. But I still see those simple work
arounds in my code even though they are no longer required (or it's
just my lack of programming skill). Don't ask what they are - I won't
answer.
;c)
I hand code my forms.
Not because the GUI designer is not stable but because once the bulk
of the thing is done changing the apps visual design is just a cut and
paste operation. The same when you change your mind about where do
methods and functions belong. It's just easier to redesign. And
because any changes will be easier to see if you do a diff between two
versions.
Not difficult really, I use Spyder for coding, so do a change in the
form, <Ctrl>-s (save), <F5> (run), and there you have it.
About the data structure, I had heard that there might be difficulties
when the framework deduced the data types, so I'd rather do it myself.
I've had bad experiences with frameworks over guessing what the user
wants to do (stay far, far away from Genexus...brrrr).
Ok, so just for the sake of it I tried getting rid of the data structure
in my bizobjs. Here's the result :
2013-09-13 09:54:08 - ERROR - _correctFieldType() failed for field:
'NroTarjeta' (<type 'int'>); value: 00ED53A2 (<type 'str'>)
It's really a field containing an hex value. As I have not found a nice
way of storing hex values as such (I want the zero fill and I don't want
to be bothered to give it a format every time I show it) I store them as
strings. This confuses the framework.
So it's as I said before. If the framework has to guess what you want to
do then you'll be forever outguessing the framework. Not my cup of tea.
OTOH, I also tried getting rid of the addFields and there was a problem
with the alias. In my structure there are many fields (in different
tables) called "Nombre". I use alias when I need to include their lookup
in some other bizobj. When I did this the framework got confused and
showed me the wrong "Nombre" in the calculated field. So as much as I
hate doing the same thing twice (addFrom and DataSource) it looks like
the safest way to go.
_______________________________________________
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]