diff options
Diffstat (limited to 'acf2/model')
-rw-r--r-- | acf2/model/aaa.lua | 5 | ||||
-rw-r--r-- | acf2/model/field.lua | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/acf2/model/aaa.lua b/acf2/model/aaa.lua index dcd9a58..7a650a8 100644 --- a/acf2/model/aaa.lua +++ b/acf2/model/aaa.lua @@ -4,6 +4,7 @@ See LICENSE file for license details --]] local M = require('acf2.model') +local object = require('acf2.object') local digest = require('crypto').digest @@ -19,7 +20,9 @@ end local hash_pattern = '^(%w+)%$(%w+)%$%x+$' -local Password = require('acf2.object').class(M.String) +local Password = object.class(M.String) + +function Password:init() object.super(self, Password):init{detail=true} end function Password:normalize(context, value) if value:find(hash_pattern) then return value end diff --git a/acf2/model/field.lua b/acf2/model/field.lua index 69f36c6..76c8931 100644 --- a/acf2/model/field.lua +++ b/acf2/model/field.lua @@ -139,7 +139,8 @@ function M.Field:meta(context) end, choice ), - widget=self.widget + widget=self.widget, + detail=self.detail } ) end @@ -305,8 +306,9 @@ end M.TreeNode = class(M.Field) function M.TreeNode:init(params) - if not params.widget then params.widget = 'link' end - super(self, M.TreeNode):init(params) + super(self, M.TreeNode):init( + setdefaults(params, {detail=true, widget='link'}) + ) end function M.TreeNode:topology(context) |