On 11/11/05, Kieren Diment <[EMAIL PROTECTED]> wrote:
>
>
>
> On 11 Nov 2005, at 19:41, David Baird wrote:
>
> > On 11/11/05, Kieren Diment <[EMAIL PROTECTED]> wrote:
> >
> > <snip everything>
> > <snip lots of symptoms>
> >
> > Can you post your driver (BeerDB), base model (BeerDB::DBI), and one
> > model subclass (BeerDB::Beer)?
> >
>
>
> No worries. Here's a tarball:
>
OK.
1) The driver (BeerDB.pm) is nothing to do with the model, so in
BeerDB.pm get rid of this:
> use base 'Maypole::Model::CDBI::Plain';
Then change this:
> BeerDB->config->model('Maypole::Model::CDBI::Plain');
to
BeerDB->config->model('BeerDB::DBI');
2) Maypole::Application has got nothing to do with the model, and
FromCGI and AsForm will be loaded by the Maypole model which your
custom model inherits from. Change the base model (BeerDB::DBI), from
this:
> package BeerDB::DBI;
> use base qw/Maypole::Application Maypole::Model::CDBI::Plain/;
> use Class::DBI::FromCGI;
> use Class::DBI::AsForm;
> BeerDB::DBI->connection('dbi:mysql:beer', 'root', '');
> 1;
to this:
package BeerDB::DBI;
use base qw/Maypole::Model::CDBI::Plain/;
BeerDB::DBI->connection('dbi:mysql:beer', 'root', '');
1;
3) Finally, in your model subclasses, you need to include the primary
key in the list of columns, so e.g. in BeerDB::Beer, change this
> BeerDB::Beer->columns(All => qw/brewery style name url score price/);
to
BeerDB::Beer->columns(All => qw/id brewery style name url score price/);
d.
-------------------------------------------------------
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