[luci] TypedSection :exclude not working

Steven Barth steven at midlink.org
Mon Feb 9 09:57:45 CET 2009


Hi Michael,
> Am I doing wrong?
No, sorry the documentation was just not up-to-date. I've fixed it there.

> Also, I cannot find docs for the filter() and validate() function in the
> example. Must I use "filter" to replace the "exclude" function?
filter is right but its not a function call anymore. You have to override this 
function.

Example:
	s = m:section(TypedSection, ...) 
	function s.filter(self, sectionname)
		if (sectionname == "unwanted") then
			return nil
		else
			return sectionname
		end
	end

This would have the same effect as the old.
	s:exclude("unwanted")

But offers greater flexibility.

Have a nice day
Cyrus


More information about the luci mailing list