On Tue, Oct 25, 2005 at 04:27:30PM +0100, Aaron Trevena wrote:
> I think we need to document using customised vs standard classes, a
> lot of Maypole stuff JustWorks(TM) with the standard classes, and this
> technique builds on this without much mucking about.

As someone that has been using Maypole a bit, but doesn't have a
complete understanding of the whole class structure, having more
examples is what I find the most useful.  That was the biggest
attraction for me in the beginning - the beerdb example was something
that I could take and immediately start modifying and playing with.

A good example (and my question for this mail).  I want to override
the column_type procedure (some of the varchar fields from oracle I
would like as textareas)  If I create something like:

sub FigDB::Hardware::column_type {
    my ($self, $column) = @_;
    
    return "TEXT" if $column eq "dscpt";
    return "varchar";
}

I get a message in the logs:

Subroutine FigDB::Hardware::column_type redefined at 
/usr/share/perl5/Class/DBI/Plugin/Type.pm line 43.

and my version never gets called.  My solution was to add the line:

    return if $caller->can("column_type");

in the middle of /usr/share/perl5/Class/DBI/Plugin/Type.pm before it
defines the column_type subroutine in the import sub.  I would rather
not hack the Plugin, but how can I override it?

Thanks,
Jim

-- 
Jim Mintha                                       Email: [EMAIL PROTECTED]
System Administrator                              Work: +31 20 525-4919
Informatiseringscentrum                           Home: +31 20 662-3892
University of Amsterdam               Debian GNU/Linux: [EMAIL PROTECTED]
_There are always Possibilities_                  http://www.mintha.com


-------------------------------------------------------
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

Reply via email to