[Dbix-class] Relationship problems
Josef Karthauser
joe at tao.org.uk
Sat Nov 11 16:00:46 GMT 2006
On Sat, Nov 11, 2006 at 01:17:17AM +0000, Josef Karthauser wrote:
> Okie; so are 'self' and 'foreign' magic labels?
>
> How does that translate into prefetch calls? (code extract from
> catalyst follows),
>
> my $rs = $c->model('Contact')->
> search($criteria,
> { page => $page, rows => 10,
> order_by => [$order_by, $default_order, "domains.domainname"],
> #1 prefetch => { 'domains' }
> #2 prefetch => { 'domains' =>
> #2 { 'self.contactid' => 'foreign.registrant',
> #2 'self.owner' => 'foreign.owner' }}
> });
>
> Neither of #1 or #2 appear to do what I want. I get 'No such
> relationship' whenever I try and process the request.
>
> Am I missing a whole chunk of manual somewhere? I've scoured most of
> it I think.
>
What do you reckon? Does anyone have any hints for me for prefetching
based upon multicolumn keys? I would have thought that #1 would work,
seeing as the correct relationships are already described in the class
files.
Joe
--
Josef Karthauser (joe at tao.org.uk) http://www.josef-k.net/
Physics Particle Theory (student) http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://jules.scsys.co.uk/pipermail/dbix-class/attachments/20061111/5ab12409/attachment.pgp
More information about the Dbix-class
mailing list