request="INSERT INTO {0}.{1} ({2}) VALUES ({3}) RETURNING id".format(self.base.schema,self.table_name,','.join(self.entries.keys()),','.join(["%s"foriteminparams])),params
returnrequest
defdelete(self):
request,params="DELETE FROM {0}.{1} WHERE id={2}".format(self.base.schema,self.table_name,self.id),[]
self.base.performRequest(request,params)
defupdate(self):
params=list()
keys=list()
forkey,valueinself.entries.items():
if(value==None):
continue
_type=self.types[key]
# print (_type)
# print (key)
# print (type(value))
if(_type==datetime.datetime):
continue
# _type = str
keys.append(key)
params.append(_type(value))
request="UPDATE {0}.{1} SET ({2}) = ({3}) WHERE id = {4}".format(self.base.schema,self.table_name,','.join(keys),','.join(["%s"foriteminparams]),self.id)