On 10 Nov 2005, at 09:35, David Baird wrote:
On 11/9/05, Kieren Diment <[EMAIL PROTECTED]> wrote:
<snip>
My brief experiment showed me that the untaint statements don't work
if they're moved into the model classes, so for example the statement
BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/]);
in Brewery.pm doesn't work (the error message is something like:
<snip error output>
It's because your model classes aren't inheriting from the appropriate
base class. See below. (This is also why you're getting errors with
Exported methods).
Instead of inheriting from CDBI, [BeerDB::DBI] should inherit from
Maypole::Model::CDBI::Plain (which, in turn, inherits from CDBI).
It worked when I used:
use base qw/Maypole::Application Maypole::Model::CDBI::Plain
Class::DBI/;
<snip>
[...]So that's quite a lot of code (for a trivial Maypole
application).
Now we need to wrap it all up in a driver class fro Maypole: this
lives (according to my scheme) in /usr/local/src/beer/lib
=over
=item BeerDB.pm
package BeerDB;
use base 'Maypole::Application';
Just say use 'Maypole::Application'; Probably doesn't make any
difference to whether things work or not, but if you examine the
inheritance, it'll be a bit simpler.
That's fine. That's a bug in the documentation for
Maypole::Model::CDBI::Plain.
use BeerDB::Beer;
use BeerDB::Brewery;
use BeerDB::Handpump;
use BeerDB::Pub;
use BeerDB::Style;
It turns out these are un-nescessary and causes the application to
break . It's all taken care of in the call to BeerDB::setup.
Thanks, this seemed to work (for now?). And its only an hour and a
half through the working day! Might even get CokeWorks refactored
properly now!
I think inheritance issues have been my bigest stumbling block in
terms of working with Maypole.
kd
-------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maypole-users