libs/uci: support custom initalizers in luci.model.uci.bind
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 27 Oct 2009 21:38:15 +0000 (21:38 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 27 Oct 2009 21:38:15 +0000 (21:38 +0000)
libs/uci/luasrc/model/uci/bind.lua

index 6f9060d..84cfc77 100644 (file)
@@ -45,6 +45,10 @@ function bind.section(self, stype)
                inst.bind  = self
                inst.stype = stype
                inst.sid   = sid
                inst.bind  = self
                inst.stype = stype
                inst.sid   = sid
+
+               if inst._init then
+                       inst:_init(sid)
+               end
        end
        return x
 end
        end
        return x
 end