Re: [Maypole] edit by unique field

From: Kevin Connor (kconnor at proofpoint.com)
Date: Wed Oct 06 2004 - 05:03:13 BST


> What you want is probably a custom action rather than overriding
> retrieve.
>
> in your cdbi class you would populate your object using something like
>
> sub edit : Exported {
> my ($self,$r) = @_;
> $r->objects( [ $self->search(foo=>$r->{args}]);
> }
>
> or use your unique string as the primary key of the table (with
> whatever performance gotchas that might bring).
>
> Marcus - Who is going to bed
>
Thanks very much for the help. I think your suggestion is probably the
way Maypole would have people add this functionality. It's ashame
though that Maypole::Model::Base::process() will make an unnecessary
call to retrieve() before calling edit() which will then do it's own
retrieve. Worse, if the DBI handle was created with RaiseError, I think
that call will die. (I should maybe try it :-) )

It seems things could be ironed out a little bit.

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



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