def save(self):
    ms = mysql_conn.Mysql()
    field_list = []
    field_list_value = []
    char_list = []
    for (k, v) in self.mappings.items():
        if (not v.primary_key):
            field_list.append(v.name)
            char_list.append('?')
            field_list_value.append(getattr(self, v.name, v.default))
    sql = ('insert into %s(%s) value(%s)' % (self.table_name, ','.join(field_list), ','.join(char_list)))
    sql = sql.replace('?', '%s')
    ms.execute(sql, field_list_value)
def save(self):
    ms = mysql_conn.Mysql()
    field_list = []
    field_list_value = []
    char_list = []
    for (k, v) in self.mappings.items():
        if (not v.primary_key):
            field_list.append(v.name)
            char_list.append('?')
            field_list_value.append(getattr(self, v.name, v.default))
    sql = ('insert into %s(%s) value(%s)' % (self.table_name, ','.join(field_list), ','.join(char_list)))
    sql = sql.replace('?', '%s')
    ms.execute(sql, field_list_value)