Did you include the isa_class sub as well from SuperModel.pm? You'll need that. 


On 8/29/05, Brad Jones <[EMAIL PROTECTED]> wrote:
> Hello,
>     I have had the my maypole app up and running for a few weeks. I have
> added new tables to my DB before and have not had problems, until now.
>     I am getting the following debug output:
> 
> debugging (level 1) enabled for CircuitDB at
> /usr/lib/perl5/site_perl/5.8.5/Maypole/Application.pm line 40.
> Loaded tables:
> avg_use_business,avg_use_nonbusiness,brad,circuit,circuit_billing_detail,circuit_interface_detail,last_check,site,site_thinness,vendor
> at /usr/lib/perl5/site_perl/5.8.5/Maypole/Model/CDBI.pm line 245.
> caught view error: Can't locate object method "isa_class" via package
> "CircuitDB::Brad" at /etc/apache/lib/perl5/CircuitDB.pm line 22.
> Can't locate object method "isa_class" via package "CircuitDB::Brad" at
> /etc/apache/lib/perl5/CircuitDB.pm line 22.
> :  at /usr/lib/perl5/site_perl/5.8.5/Maypole.pm line 128
> Use of uninitialized value in length at
> /usr/lib/perl5/site_perl/5.8.5/Apache/MVC.pm line 86.
> Use of uninitialized value in subroutine entry at
> /usr/lib/perl5/site_perl/5.8.5/Apache/MVC.pm line 95.
> 
> 
>   At first I thought there was some problem with the class creation name
> as I had underscores in the name. So I changed the table name to 'brad'
> to try and rule that out. Here is what I have in my module for the class:
> 
> CircuitDB::Brad->untaint_columns( printable =>["site", "switch_name"],
>                                          integer => ["total_GE",
> "total_FE", "free_GE", "free_FE", "last_check"]);
> sub CircuitDB::Brad::display_columns{qw[switch_name site total_FE
> free_FE total_GE free_GE last_check]};
> 
> 
> Per Peter's recomendations I have included a version of column_type in
> my module:
> 
> sub Maypole::Model::CDBI::column_type {
>     my $class = shift;
>     my $col = shift or die "Need a column for column_type";
> 
>     my $type =  $class->_column_info->{$col}->{type} || '';
>         my $colclass = $class if $type;
>         unless ($type) {
>                 # check is_a for type
>                 my $isa_class = $class->isa_class($col);
> ###<<<<<<<<<Line 21
>                 if ($isa_class) {
>                         $colclass = $isa_class;
>                         $type = $isa_class->column_type($col)
>                 }
>         }
> 
>         if ($type and $type =~ /^tinyint\(1\)$/i) {
>                 # how we display these bool columns: No, Yes, 0, 1, Off,
> On etc.
>                 my $bool = eval { $colclass->bool_columns->{$col}; };
>                 $type = "bool";
>                 $type .= "(" . join (',', @$bool) . ")" if $bool;
>         }
>         return $type;
> }
> 
> 
> The reference to line 21 is marked above.
> 
> 
> Any help would be appreciated.
> 
> Brad
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Maypole-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/maypole-users
> 


-- 
pjs


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Maypole-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to