[% FOREACH stat = c.model('Accounts').db.search_objects( 'stat', 'exported=true' ).sort %] [% IF loop.first %] [% END %] [% END %]