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?
Marcus
On 6. des. 2004, at 00.25, Simon Flack wrote:
> On Mon, 6 Dec 2004 00:14:01 +0100, Marcus Ramberg wrote
>> On 5. des. 2004, at 23.54, Simon Flack wrote:
>>
>>> On Sun, 5 Dec 2004 23:17:18 +0100, Marcus Ramberg wrote
>>>
>>>> Unless ... Maybe a general populate_objects method
>>>> or something would be better? That way you could override how
>>>> initial population goes on a class-by-class basis?
>>>
>>> I think that's what retrieve() is for.
>>
>> Overriding "retrieve" on a class::dbi class is probably not a good
>> idea.
>
> No, perhaps I misunderstood your question. What would populate_objects
> do?
>
> --simonflk
>
>
> _______________________________________________
> maypole-dev mailing list
> maypole-dev at lists.netthink.co.uk
> http://lists.netthink.co.uk/listinfo/maypole-dev
_______________________________________________
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