[Templates] Geez, how do I get single db value

Andy Wardley abw@andywardley.com
Wed, 6 Nov 2002 18:01:35 +0000


Dennis Daupert wrote:
[...]
> but I haven't yet been able to figure out how to do a single SELECT
> and return an fname to a variable that will display. What am I missing
> here?

Hmm yes, this is one of those things that is neither obvious, documented
nor consistent with list virtual methods.  (makes a mental note to look
at this and at least update the docs).

I think you should be able to do this:

<h3>Welcome, [% users.get.fname %]</h3>

The DBI plugin returns an iterator which doesn't quite behave 
exactly like a list.  You need to call get() to get an item from
it instead.

HTH
A