Re: [Maypole] delete -> 404

From: Johan Lindstrom (johanl at DarSerMan.com)
Date: Sun Jan 23 2005 - 21:03:50 GMT


At 18:57 2005-01-23, Peter Speltz wrote:
>3** ) Error before delete method gets called. this is usually a
> relationship error or database not in synch with cdbi classes ie column name
>different, not there, etc that causes a require to halt before getting to the
>delete method for example.

Found this trick at http://maypole.perl.org/?ManualRequest to remove Apache
from the equation:
perl -MMaypole::CLI=BeerDB -e1 "http://localhost/beerdb/brewery/delete/7"

Which yields:
Loaded tables: beer,brewery,handpump,pub,style at
C:/appl/dev/mod_perl/Perl/site/lib/Maypole/Model/CDBI.pm line 241.
CDBI::delete() at C:/appl/dev/mod_perl/Perl/site/lib/Maypole/Model/CDBI.pm line
142.
caught model error: Can't call method "delete_all" without a package or
object reference at
C:/appl/dev/mod_perl/Perl/site/lib/Class/DBI/Relationship/HasMany.pm line 61.
Can't call method "delete_all" without a package or object reference at
C:/appl/dev/mod_perl/Perl/site/lib/Class/DBI/Relationship/HasMany.pm line 61.
: at C:/appl/dev/mod_perl/Perl/site/lib/Maypole.pm line 118

I'll start looking at that now.

>if your using all default stuff, i'm
>guessing the problem is yoour relationship declarations in cdbi class or
>database differing from declarations in cdbi class.

This sounds likely since I remember having a few problems finding the
schema DDL in order to convert it to MySQL. There is none in the CPAN
distro, right?

I started with the one at http://maypole.perl.org/?About, but that isn't a
complete schema. So I found one in the perldoc Maypole::Manual::About. I
can imagine that it's not in sync with the db in t/beerdb.db .

Is there a DDL file for the BeerDB database anywhere which I missed?

For future reference, this is my MySQL DDL:

drop table brewery
;
drop table beer
;
drop table handpump
;
drop table pub
;
drop table style
;

create table brewery (
     id int not null auto_increment primary key,
     name varchar(30),
     url varchar(50),
     notes text
);

create table beer (
     id int not null auto_increment primary key,
     brewery integer,
     style integer,
     name varchar(30),
     url varchar(120),
     score integer(2),
     price varchar(12),
     abv varchar(10),
     notes text
);

create table handpump (
     id int not null auto_increment primary key,
     beer integer,
     pub integer
);

create table pub (
     id int not null auto_increment primary key,
     name varchar(60),
     url varchar(120),
     notes text
);

create table style (
     id int not null auto_increment primary key,
     name varchar(60),
     notes text
);

/J

-------- ------ ---- --- -- -- -- - - - - -
Johan Lindström Sourcerer @ Boss Casinos johanl AT DarSerMan.com

Latest bookmark: "TCP Connection Passing"
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12

_______________________________________________
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:57 GMT