[CDBI] Obtain has_a Module Through find_column

[prev] [thread] [next] [Date index for 2005/11/07]

From: Jay Hargreaves
Subject: [CDBI] Obtain has_a Module Through find_column
Date: 18:45 on 07 Nov 2005
Hi everyone!

I am looking to setup a generic form for creating database entries. I 
need to obtain information on a has_a relationship through the 
find_column method so I can populate a drop-down list with available 
values. My MyModule::Link table module contains the following line:

__PACKAGE__->has_a(link_category_id => 'MyModule::LinkCategory' );

At runtime I have no knowledge of the mapped module so I want to access 
this information somehow, for instance:

my $column = MyModule::Link->find_column('link_category_id');
my $column_module = $column->module_name; # made up method providing the
    # name of the has_a mapped module

This is so I can then load the module and retrieve all available values 
from it to populate the dropdown list. Is there any such 'module_name' 
method or any other way in which I might obtain this information?

Thanks
Jay

        -- 
        bingo, bango, bosh...

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

[CDBI] Obtain has_a Module Through find_column
Jay Hargreaves 18:45 on 07 Nov 2005

Re: [CDBI] Obtain has_a Module Through find_column
Jay Hargreaves 10:02 on 08 Nov 2005

Generated at 20:55 on 09 Nov 2005 by mariachi v0.52