Re: [Maypole-dev] Re: Patch to support compound primary keys

From: Simon Flack (sf at flacks.net)
Date: Mon Dec 06 2004 - 00:29:39 GMT


On Mon, 6 Dec 2004 00:39:26 +0100, Marcus Ramberg wrote
> populate $r->objects from $r->{args}[0]
>
> For example, in my case, the the wiki I'm building, I could use this
> to set this to
> sub Mitiki::Page::populate_objects {
> my ($class,$r) = @_;
> my @obj = Mitiki::Page->search( node => $r->{args}->[0] );
> $r->objects([$obj[0]]);
> }
>
> (since I use a numeric id, not the node name, for pk but that's what
> I'll want to reference)
>
> Did that clear it up?

Yes, but that's more or less what retrieve() is for:

    =head2 retrieve
    
    This turns an ID into an object of the appropriate class.

Adding something so similar with a different name is a bit confusing. Isn't
this just an example of a case where you need to define your own Model::process()?

--simonflk

_______________________________________________
maypole-dev mailing list
maypole-dev at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole-dev



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT