Maypole tries to fetch_objects for the model_class every request.
This is not good say if the model_class does not correspont to a
table. Here is a patch for Maypole::Model::CDBI fetch_objects so it
wont fetch objects unless the class has primary columns.
Here is the new sub . No need for diff. I labeled changes
sub fetch_objects {
my ($class, $r)[EMAIL PROTECTED];
#my @pcs = $class->primary_columns;
my @pcs = eval { $class->primary_columns }; # pjs
return unless @pcs; #pjs
if ( $#pcs ) {
my %pks;
@[EMAIL PROTECTED](@{$r->{args}});
return $class->retrieve( %pks );
}
return $class->retrieve( $r->{args}->[0] );
}
I was just experimenting with making my custom $r->config->model base
class which does not have a table associated with it. execute an
action. With this patch an override of "class_of" I can say:
localhost/model_class/quick_search
It is desireable to be able to have actions in classes without tables
and have uri s map to classes without tables.
--
pjs
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Maypole-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-devel