Tony,

>> Is it because you only want to make one request to the database for
>>information that's stored on one record?

Not quite, but good guess !! We have accessor functions to a remote machine
where we store configuration information about things (computers to be
specific). We have functions like "get_ip" and "get_hostname", etc. These
field values are used in a template like

<ul>
    <li> Your IP: [% ip %] </li>
    <li> Your hostname : [% hostname %] <li>
</ul>

There is quite a bit of information but I only have 2 choices: get them 1
field at a time (i.e. use the accessor) OR get a list of fields (ip,
hostname). I don't want to populate a list with ALL possible values as this
is quite compute intensive and A LOT of data.

So, I hoped I could ask the template engine, "Give me a list of values you
need", it would return "Sure, (ip, hostname)" then I could get JUST the ones
I wanted. Then I would, process(template, list); and all would be well.

I found a similar request to this while scanning the archives, and it
appears that this just might not be possible. That person wanted a list of
variables names such that they could construct a "SELECT field1, field2 FROM
db" clause.

Thanks
Andy





Reply via email to