Commit e0c59fcf authored by astaxie's avatar astaxie

add more comments

parent 083f697c
...@@ -103,6 +103,8 @@ func bootStrap() { ...@@ -103,6 +103,8 @@ func bootStrap() {
goto end goto end
} }
// set rel and reverse model
// RelManyToMany set the relTable
models = modelCache.all() models = modelCache.all()
for _, mi := range models { for _, mi := range models {
for _, fi := range mi.fields.columns { for _, fi := range mi.fields.columns {
...@@ -155,6 +157,8 @@ func bootStrap() { ...@@ -155,6 +157,8 @@ func bootStrap() {
} }
} }
// check the rel filed while the relModelInfo also has filed point to current model
// if not exist, add a new field to the relModelInfo
models = modelCache.all() models = modelCache.all()
for _, mi := range models { for _, mi := range models {
for _, fi := range mi.fields.fieldsRel { for _, fi := range mi.fields.fieldsRel {
...@@ -167,7 +171,6 @@ func bootStrap() { ...@@ -167,7 +171,6 @@ func bootStrap() {
break break
} }
} }
if inModel == false { if inModel == false {
rmi := fi.relModelInfo rmi := fi.relModelInfo
ffi := new(fieldInfo) ffi := new(fieldInfo)
......
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