def write_row(self, table, col_specs, row, srid=None):
        if not srid: srid=self.srid
        col_specs = colspecs.fix(col_specs)

        def code_value(col_name, col_type, value, ref):
            if col_type == 'POINT':
                return (self.code_point(value,srid),None)
            if col_type == 'LINESTRING':
                return (self.code_linestring(value,srid),None)
            if col_type == 'TEXT':
                if not isinstance(value,basestring): value = str(value)
                return (ref, value)
            return (ref, value)

        # create row dictionary
        if isinstance(row,dict):
            rowd = row.copy()
        else:
            # is this even used?
            assert len(row) == len(col_specs)
            rowd = {}
            for i in range(len(col_specs)): rowd[col_specs[i][2]] = row[i]

        # col and value list strings
        columns = []
        values = []
        parms = []
        for col_name,col_type,prop_name in col_specs:
            if not prop_name in rowd.keys(): continue
            value = rowd[prop_name]
            if value == None: continue
            columns.append( '"' + col_name + '"')
            (value,parm) = code_value(col_name, col_type, value, self._interpolation_ref)
            values.append(value)
            if parm!=None: parms.append(parm)
            
        columns = ','.join(columns)
        values = ','.join(values)

        # create sql template for row
        sql_template  = ''' 
                    INSERT INTO %(table)s 
		        (%(columns)s)
                    VALUES
		        (%(values)s);
                    ''' % {
                        'table':table,
                        'columns':columns,
                        'values': values
                        }

        # and execute sql
        #print 'DEB sql_template:', sql_template
        self.exec_sql(sql_template,parms)
dataset/ETHPy150Open mharnold/spiderosm/spiderosm/dbinterface.py/DatabaseInterface.write_row/original