[Catalyst] Dumb question of a beginner

Matt S Trout dbix-class at trout.me.uk
Mon Feb 11 18:59:19 GMT 2008


On Mon, Feb 11, 2008 at 01:21:15PM +0300, Alex Povolotsky wrote:
> Chisel Wright wrote:
> >On Mon, Feb 11, 2008 at 12:55:55PM +0300, Alex Povolotsky wrote:
> >  
> >>Hello!
> >>
> >>I haven't find the answer in FAQ and cookbook, so I'm asking here.
> >>
> >>How do I add server-side sorting for list operation? I want to select * 
> >>from table sort by field instead of default select * from table
> >>    
> >
> >I think you are looking for 'order_by' in perldoc DBIx::Class::ResultSet
> >
> >  
> Looking at Catalyst::Enzyme::CRUD::Controller
> 
> 
> sub list : Local {
>    my ( $self, $c ) = @_;
>    my $model = $self->model_with_pager($c, 
> $self->crud_config->{rows_per_page}, $c->req->param("page"))
> ;
>    $c->stash->{items} = [ $model->retrieve_all() ];
>    $c->stash->{template} = 'list.tt';
> }
> 
> what should I change?

Using Enzyme.

Class::DBI is obsolete; for new development you should be using
DBIx::Class. Most Cat users do, so you get better support, and DBIC is
actively developed whereas CDBI is in maintenance only mode due to the
backwards compatiblity burden it's accrued (which was the reason DBIC was
started in the first place)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list