Prune down Database.column_placeholders() a bit
This commit is contained in:
parent
e577cb2759
commit
28fd4050c7
1 changed files with 1 additions and 17 deletions
|
@ -108,23 +108,7 @@ class Database():
|
|||
return Database(db)
|
||||
|
||||
def column_placeholders(self, table, obj) -> list:
|
||||
ctors = getattr(table, '__constructors__')
|
||||
|
||||
if ctors is None:
|
||||
return ['?' for c in table.__columns__ if c != table.__key__]
|
||||
if ctors is not None:
|
||||
ret = list()
|
||||
|
||||
for c in table.__columns__:
|
||||
if c == table.__key__:
|
||||
continue
|
||||
|
||||
if c in ctors:
|
||||
ret.append(ctors[c](getattr(obj, c)))
|
||||
else:
|
||||
ret.append('?')
|
||||
|
||||
return ret
|
||||
return ['?' for c in table.__columns__ if c != table.__key__]
|
||||
|
||||
def add(self, obj):
|
||||
fn = getattr(obj, '__insert__')
|
||||
|
|
Loading…
Add table
Reference in a new issue