Further simplification.
This commit is contained in:
parent
07bb84e1b6
commit
d5461bd008
@ -53,14 +53,13 @@ def building_out_converter(obj):
|
|||||||
|
|
||||||
def input_type_handler(cursor, value, num_elements):
|
def input_type_handler(cursor, value, num_elements):
|
||||||
if isinstance(value, Building):
|
if isinstance(value, Building):
|
||||||
return cursor.var(oracledb.OBJECT, arraysize=num_elements,
|
return cursor.var(obj_type, arraysize=num_elements,
|
||||||
inconverter=building_in_converter, typename=obj_type.name)
|
inconverter=building_in_converter)
|
||||||
|
|
||||||
def output_type_handler(cursor, name, default_type, size, precision, scale):
|
def output_type_handler(cursor, name, default_type, size, precision, scale):
|
||||||
if default_type == oracledb.OBJECT:
|
if default_type == oracledb.OBJECT:
|
||||||
return cursor.var(oracledb.OBJECT, arraysize=cursor.arraysize,
|
return cursor.var(obj_type, arraysize=cursor.arraysize,
|
||||||
outconverter=building_out_converter,
|
outconverter=building_out_converter)
|
||||||
typename=obj_type.name)
|
|
||||||
|
|
||||||
buildings = [
|
buildings = [
|
||||||
Building(1, "The First Building", 5, datetime.date(2007, 5, 18)),
|
Building(1, "The First Building", 5, datetime.date(2007, 5, 18)),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user