[luci] CBI: How do I filter based in the value of an option

luoluo luoluohaliyou at gmail.com
Tue Feb 16 11:48:37 CET 2010


I am trying to do the same things. your hints is very useful. thanks.

2010/2/16 Chris Martin <chris at martin.cc>

> On Tue, Feb 16, 2010 at 7:06 PM, Chris Martin <chris at martin.cc> wrote:
> > I want to be able to display interfaces based on the "proto" option
> >
> > I want to do something like the following:
> >
> > m = map ("network", "title", "description")
> > s = m:section(TypedSection, "interface", "")
> > function s.filter(self, section)
> >       return somehow_get_the_option(self, section, "proto") == "gre"
> > end
> >
>
> As always - moment after going to the mailing list for help I have
> managed to figure this out
> I'm post the result for any one who is interested - or in case any one
> has a better method
>
> m = map ("network", "title", "description")
> s = m:section(TypedSection, "interface", "")
> function s.filter(self, section)
>       return self.map:get(section, "proto") ~= "gre"        <---- here
> is the magic
> end
>
> Cheers
>
> > ----------------------------------------------------------
> > Chris Martin
> > m: 0419812371
> > ----------------------------------------------------------
> >
> _______________________________________________
> luci mailing list
> luci at lists.subsignal.org
> https://lists.subsignal.org/mailman/listinfo/luci
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.subsignal.org/pipermail/luci/attachments/20100216/415a2453/attachment.htm 


More information about the luci mailing list