Prune down Database.column_placeholders() a bit

This commit is contained in:
XANTRONIX Industrial 2025-02-14 13:48:16 -05:00
parent e577cb2759
commit 28fd4050c7

View file

@ -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__')