[Templates] Trying to remember the change
Bill Moseley
moseley at hank.org
Wed Feb 27 20:59:00 GMT 2008
On Wed, Feb 27, 2008 at 12:54:49PM -0800, Randal L. Schwartz wrote:
> >>>>> "Bill" == Bill Moseley <moseley at hank.org> writes:
>
> Bill> Want to list ids associated with artists and show the ids in order.
> Bill> The cd objects stringify to its id.
>
> Bill> CD ISs: [% artist.cds.nsort.join( ', ' ) %]
>
> Bill> This works if the artist has more than one CD. If they only have one
> Bill> then I get:
>
> Bill> CD IDs: id
>
> Bill> Note the string "id".
>
> What is making artist.cds ? It needs to return an arrayref,
> not a list. The magical list return stuff makes a single item
> into a scalar, and multiple items into an array. That's your breakdown.
Ah, yes. It's CDBI so in list context it's returning a list not a
an array ref. I guess that's why I have that as_list() function.
--
Bill Moseley
moseley at hank.org
More information about the templates
mailing list