On 3/4/2015 18:03, Paul McNett wrote:
On 3/4/15 8:39 AM, Werner wrote:
On 3/4/2015 17:37, Werner wrote:
On 3/4/2015 16:40, Paul McNett wrote:
...
I was going to say we should use six to help the transition between 2
and 3 but see that six doesn't solve this issue for us.
Was hoping for that too, but no look.
You need to rewrite that to take into account None being a possible
value in [2] or [3] (order None as less than everything). That will
be cross compatible.
Hhm, not my strength, here is what I came up with as a test, but it
looks a bit long.
Here's what I would do (can't remember for the life of me what
field_info[2] and [3] are though):
Thanks, 'display_size' and 'internal_size' from the dbapi 2.0? Also
with sqlite all is None in .description except the first (name).
https://www.python.org/dev/peps/pep-0249/#cursor-objects
diff --git a/dabo/db/dBackend.py b/dabo/db/dBackend.py
index 7ffb0bc..a52dd84 100644
--- a/dabo/db/dBackend.py
+++ b/dabo/db/dBackend.py
@@ -534,8 +534,12 @@ class dBackend(dObject):
field_name = ustr(field_info[0])
field_type = self.getDaboFieldType(field_info[1])
field_names.append(field_name)
+ if type(field_info[2]) == type(field_info[3])
and field_info[2] is not None:
+ max_field_2_3 = max(field_info[2],
field_info[3])
+ else:
+ max_field_2_3 = None
field_structure[field_name] = (field_type, False,
- max(field_info[2],
field_info[3]) or None, field_info[5] or None)
+ max_field_2_3, field_info[5]
or None)
Looks much better, thanks.
Werner
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]