On Tue, 2005-10-25 at 11:48 +1000, Kieren Diment wrote:
> I'm trying to rig together a fairly minimal Maypole app to look at
> the contents of a database. As soon as I try to introduce a :
> Exported method into the app I get invalid code attribute errors like
> this:
>
> [Tue Oct 25 10:04:13 2005] [error] Invalid CODE attribute: Exported
> at /usr/loca
This error tells you that the model inheritance is not set up properly.
<snip>
> and the driver:
>
> package Literature;
> use warnings;
> use strict;
> use Maypole::Application qw(-Debug );
>
> Literature->setup("dbi:mysql:prosthetic", "root");
> Literature->config->uri_base("http://localhost/lit");
> Literature->config->{template_root} ="/usr/local/src/Literature/
> templates";
> Literature->config->{application_name} = "Restoration Ecology
> Literature Search";
> Literature->config->rows_per_page(100);
> Literature->config->display_tables([qw/journal/]);
> Literature::Journal->untaint_columns( printable => [qw/bibref/]);
> {
> package Journal;
> sub fulltext : Exported {}
> }
> 1;
>
> Is there something simple I'm missing?
You want Journal to be a model package (i.e. use Exported attributes)
but you haven't told it to inherit any model behaviour. It looks like it
should be called Literature::Journal. I think that's enough. In some
other circumstances you might also need to manipulate its @ISA or
explicitly use base 'Your::Model::BaseClass' if you have one.
Cheers, Dave
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Maypole-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users