Hi,

I just started my first project using Catalyst and therefor I am also using DBIx::Class the first time. I'm pretty amazed by the features and the flexibility (given the fact that I only worked with DBI before).

Anyhow I noticed something weird during my development work.
(btw. I am using the Template Toolkit for my Template work)

For a very simple list output of my database entries, I am using s. th. like this as Catalyst
action:
===================================================
sub list :Path :Args( 0 )
{

        ## Get object and context
        my ( $self, $c ) = @_;

        ## Get ResultSet
        my $rs = $c->model( 'DB::Vorgaenge' );

        ## Sort the ResultSet by ID
        my $search = $rs->search( undef, { order_by => 'id' } );

        ## Store the vorgaenge details in the stash
        $c->{ 'stash' }->{ 'vorgaenge' } = $search;

}
===================================================


And later in the template I run through each row using the TT-while directive:
===================================================
[% WHILE ( vorgang = vorgaenge.next ) -%]
<tr onClick="window.location='[% c.uri_for( c.controller.action_for( 'show' ), [ vorgang.id ] ) %]'">
              [...]
[% END %]
===================================================


Now if I have a look at the DBI_TRACE output of this action, the corresponding query looks like this:
===================================================
SELECT me.id, me.praxis, [...] me.email FROM praxis me WHERE ( ( me.id = ? AND me.id = ? ) ): '1', '1'
===================================================


And I am wondering why DBIx::Class add the duplicate me.id in the WHERE clause. It doesn't make any sense to define this twice. Any idea why this happens or if I am doing something wrong?


Thanks
Winni
--
Winfried Neessen
eMail: [email protected]
PGP/GPG Key-ID: 0xda5cd8ef

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]

Reply via email to