[Catalyst] How do you structure multi-table DBIx queries?

Dennis Daupert ddaupert at sbcglobal.net
Tue Jul 25 15:04:38 CEST 2006


> did you look at DBIx::Class::Manual::Cookbook ?

Yes indeed, it has lots of good examples

> $rs=$c->model('YourDB::Quotes')->search();
> while($quotes=$rs->next()) {
> # grab quotes.quote 
>  my $categories=$quotes->category;               
> # this is really cool, because $categories 
> # can be used to get any of the data in the table categories. 
# which is why I give it the table name, not the column name. 
>  my $category_id=$categories->category;

Thanks, I will play with that tonight.

> I also use schema loader, I don't know how much of that 
> accomplishes the coolness above.

I used the hand-rolled method. I'm not knowledgeable enough yet to
know just how cool my code is; probably lukewarm ;-)

best, 

/dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060725/dd626b43/attachment.htm 


More information about the Catalyst mailing list