Description

add models to origin models when creating queryM2M. example:

	m2m := orm.QueryM2M(post,"Tag")
	m2m.Add(&Tag1{},&Tag2{})
 	for _,tag := range post.Tags{}{ ... }

param could also be any of the follow

[]*Tag{{Id:3,Name: "TestTag1"}, {Id:4,Name: "TestTag2"}}
&Tag{Id:5,Name: "TestTag3"}
[]interface{}{&Tag{Id:6,Name: "TestTag4"}}

insert one or more rows to m2m table make sure the relation is defined in post model struct tag.

Add is referenced in 8 repositories

github.com/astaxie/beego github.com/liuxue0905/GoldenTimes-web github.com/endville/gpsapi

...