Mailing List Archive

[Bricolage-General] story->list ordering
All,

I'm grabbing stories to display on a cover page, as shown below. The problem
I'm having is with ordering. The Order parameter doesn't seem to be doing
anything, it's still sorting by story ID, I think. Am I doing something
incorrectly when calling the list function, or does Order not work?

my @stories = Bric::Biz::Asset::Business::Story->list({'category_id' =>
$cat_id, 'publish_status' => 1, 'Order' => 'title' });

Thanks,
Phil


-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general
Re: [Bricolage-General] story->list ordering [ In reply to ]
On Wednesday, July 24, 2002, at 04:12 PM, Philip Fibiger wrote:

> I'm grabbing stories to display on a cover page, as shown below. The
> problem
> I'm having is with ordering. The Order parameter doesn't seem to be doing
> anything, it's still sorting by story ID, I think. Am I doing something
> incorrectly when calling the list function, or does Order not work?

Looking at the sources, it looks like Order only takes cover_date or
publish_date as arguments. Otherwise, it doesn't bother to sort, which
means the sort order will be whatever PostgreSQL likes it to be. If you
provide no Order parameter, it'll default to cover_date.

> my @stories = Bric::Biz::Asset::Business::Story->list({'category_id' =>
> $cat_id, 'publish_status' => 1, 'Order' => 'title' });

Yeah, that won't work. Not sure who added the Order parameter and why they
didn't allow it to apply to other columns, but I'm afraid you're stuck for
the moment.

Regards,

David
--
David Wheeler AIM: dwTheory
david@wheeler.net ICQ: 15726394
http://david.wheeler.net/ Yahoo!: dew7e
Jabber: Theory@jabber.org



-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
Bricolage-General mailing list
Bricolage-General@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-general