From 401fb17a2763ab7e6671e53fcd601c600b0a07a8 Mon Sep 17 00:00:00 2001 From: Kaarle Ritvanen Date: Thu, 31 Oct 2013 19:44:57 +0200 Subject: model: conditional model fields --- acf2/model/field.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'acf2/model/field.lua') diff --git a/acf2/model/field.lua b/acf2/model/field.lua index 22751c2..8cbc93f 100644 --- a/acf2/model/field.lua +++ b/acf2/model/field.lua @@ -64,6 +64,7 @@ function M.Field:meta(context) res.type = self.dtype res.editable = self.editable + res.condition = self.condition res.required = self.required res.default = self.default res.choice = self.choice @@ -110,6 +111,8 @@ function M.Field:validate_saved(context) self:save(context, self:load(context)) end +function M.Field:clear(context) context.txn:set(context.addr) end + local Primitive = class(M.Field) -- cgit v1.2.3