Not long ago, Michael Higgins proclaimed... > Having worked through the tutorial with success, now, I need to make my > application. > > First question for which I can't seem to find an answer (of many to come, I > fear), is how and where does one "order by" the results? > > I am returning all the 'books', say (tutorial reference), but I'd like them > ordered. > > Where is that indicated? > > Sorry for the newbie question. Someday, I'll be an oldbie, I'm sure.
This is really a DBIC question... but it's like this:
my @books = $c->model('My::AppDB::Book')->search(
{ num_pages => { '>=', $pages }},
{ order_by => 'title'});
Basically, the order_by is the second argument to the search() function.
See: 'perldoc DBIx::Class::ResultSet'.
-=Fozz
--
[EMAIL PROTECTED] is Doran L. Barton, president/CTO, Iodynamics LLC
Iodynamics: IT and Web services by Linux/Open Source specialists
"Milk drinkers are turning to powder"
-- Headline seen in newspaper
pgpY4kuaU09OX.pgp
Description: PGP signature
_______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
