Hi,
I am writing a small catalyst application for online maintenance of leave
records at the office. I need to ensure that a dept head is not flooded with
all the leave applications, but gets only those pertaining to his dept. I
have a users table and a leave_application table. The first table contains
the user_id, user_name and dept_id columns, while the second one contains
the user_id and leave_id columns. I have declared a has_many relationship
named 'leave_apps' and a belongs_to relationship named 'usr' between the
two tables. I am unable to put the following SQL query into DBIx::Class
syntax.
select l.leave_id from leave_application l,
users u,
where u.user_id = l.user_id
and u.dept_id = $dept_id_of_dept_head;
In catalyst, I pick up the dept_id_of_the_dept_head by using
'$c->user->dept_id'.
Can someone help me please?
jagdish eashwar
_______________________________________________
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]