On Sat, Nov 11, 2006 at 12:22:35AM +0000, Jess Robinson wrote:
>
> Should be:
> __PACKAGE__->has_many(domains => 'Domain',
> { 'foreign.registrant' => 'self.contactid',
> 'foreign.owner' => 'self.owner' } );
>
> __PACKAGE__->belongs_to(registrant => 'Contact',
> { 'foreign.owner' => 'self.owner',
> 'foreign.contactid' => 'self.registrant' });
>
> > __PACKAGE__->belongs_to(contact => 'Tao::DBIx::Contact',
> > { ownerid => 'owner', contact => 'contactid' });
>
> You can figure this one out..
>
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.
Joe
--
Josef Karthauser ([EMAIL PROTECTED]) http://www.josef-k.net/
Physics Particle Theory (student) http://www.pact.cpes.sussex.ac.uk/
================ An eclectic mix of fact and theory. =================
pgpftth2mFmPK.pgp
Description: PGP signature
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
