Użytkownik Ed Leafe napisał:
> On Aug 10, 2010, at 9:49 AM, Jacek Kałucki wrote:
>
>    
>> Oh, maybe MySQL adapter does, don't know, I don't use MySQL.
>> This is thread about _MsSQL_, and it doesn't remap types.
>>      
>       The point was that *all* adapters should do that; that's the "adapt" 
> portion of the name. They should handle the conversion between the database 
> types and the Python types.
>    

There is not enough trees for paper to write what should be done, but 
isn't on this world.
As I said, default Dabo approach to map bit type as integer is correct.
But there is problem in Dabo with proper type conversion between
UI and DB layer.
Dabo hasn't pretty symmetric type mapping like e.g. SQLAlchemy,
it has equivalent mechanism, but my opinion is, it's a bit buggy.
Look at dCursorMixin.setFieldVal() method:
<code>
298|                elif isinstance(rec[fld], int) and isinstance(val, 
bool):
                            # convert bool to int (original field val 
was bool, but UI
                            # changed to int.
                            val = int(val)
</code>
This code does the job, but what happens if current field value is 'None'?
I think, that first line of this this code should be:
<code>
                 elif fldType is int and isinstance(val, bool):
</code>

-- 
Regards
Jacek Kałucki

_______________________________________________
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/4c619d73.9010...@rz.onet.pl

Reply via email to