Discussion:
[Alzabo] methodmaker issue
Otto Hirr
2007-08-03 04:07:58 UTC
Permalink
Greetings,

I have several tables with relationships between them.
All tables are to have some attributes such as
created_by, created_on, modified_by, etc.

If I turn on 'all' in MethodMaker, it will attempt to
create lookup_columns between related tables, including
items like those listed above. Only certain columns should be
used as lookup_columns, but not others.

Furthermore MethodMakers complains about (as example):

MethodMaker: Creating lookup_columns method
MyApp::Data::Row::event->modified_on \
will override the method of the same name in the parent class
MethodMaker: skipping lookup_columns method
MyApp::Data::Row::event->modified_on \
subroutine already exists.

Question, I want to use 'all' for MethodMaker as a general rule,
but then create exceptions...

How can this be done, or am I missing something.

Regards,

..Otto
David A.
2007-08-09 20:30:23 UTC
Permalink
I think you can skip unwanted column names using customized namer sub.
http://www.alzabo.org/docs/Alzabo/MethodMaker.mhtml#NAMING%20SUB%20EXAMPLE
In your case the following block seems to apply:

...
if ( $p{type} eq 'lookup_columns' )
{
return join '_', map { lc $_->name } $p{foreign_key}->table_to, $p{column};
}
...


if you the column name matches one in your list, simply skip it and go to
the next.
Post by Otto Hirr
Greetings,
I have several tables with relationships between them.
All tables are to have some attributes such as
created_by, created_on, modified_by, etc.
If I turn on 'all' in MethodMaker, it will attempt to
create lookup_columns between related tables, including
items like those listed above. Only certain columns should be
used as lookup_columns, but not others.
MethodMaker: Creating lookup_columns method
MyApp::Data::Row::event->modified_on \
will override the method of the same name in the parent class
MethodMaker: skipping lookup_columns method
MyApp::Data::Row::event->modified_on \
subroutine already exists.
Question, I want to use 'all' for MethodMaker as a general rule,
but then create exceptions...
How can this be done, or am I missing something.
Regards,
..Otto
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Alzabo-general mailing list
https://lists.sourceforge.net/lists/listinfo/alzabo-general
Loading...