'Create a INSERT query in table with all data of data (a dict)'

def create_insert_query(self, table, data):

    query = (u'INSERT    INTO    %s    ' % (self.table_prefix + table))
    props_str = u'    ('
    values_str = u'    ('
    i = 0
    for prop in data:
        i += 1
        val = data[prop]
        if isinstance(val, bool):
            if val:
                val = 1
            else:
                val = 0
        val = self.stringify(val)
        if (i == 1):
            props_str = (props_str + (u'%s    ' % prop))
            values_str = (values_str + (u"'%s'    " % val))
        else:
            props_str = (props_str + (u',    %s    ' % prop))
            values_str = (values_str + (u",    '%s'    " % val))
    props_str = (props_str + u'    )')
    values_str = (values_str + u'    )')
    query = (((query + props_str) + u'    VALUES') + values_str)
    return query
