Commit 4375ca84 authored by astaxie's avatar astaxie

fix the sqlite m2m

parent 0eaf923a
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
package orm package orm
import ( import "reflect"
"reflect"
)
// model to model struct // model to model struct
type queryM2M struct { type queryM2M struct {
...@@ -48,7 +46,8 @@ func (o *queryM2M) Add(mds ...interface{}) (int64, error) { ...@@ -48,7 +46,8 @@ func (o *queryM2M) Add(mds ...interface{}) (int64, error) {
var other_names []string var other_names []string
for _, colname := range mi.fields.dbcols { for _, colname := range mi.fields.dbcols {
if colname != mfi.column && colname != rfi.column && colname != fi.mi.fields.pk.column { if colname != mfi.column && colname != rfi.column && colname != fi.mi.fields.pk.column &&
mi.fields.columns[colname] != mi.fields.pk {
other_names = append(other_names, colname) other_names = append(other_names, colname)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment