From: Bob M. <r.m...@im...> - 2010-10-27 11:05:45
|
Mostly for Rob... I have been playing a bit with introspection on BCS objects (while figuring out how to serialize them (to JSON) including one or more levels of related objects). You can get a list of relationships with this @rels = $feature->relationships but it doesn't tell you about many_to_many relationships, such as parent_features and child_features (which are added manually; I am going to be adding all the many_to_many relationships for NatDiv and related classes soon - stay tuned to http://github.com/bobular/Bio-Chado-Schema). There's a plugin which does it though, it's called DBIx::Class::IntrospectableM2M We just need to add this before the first many_to_many definition. __PACKAGE__->load_components(qw/IntrospectableM2M/); and then the m2m relationships and their get/set/add/remove method names can be obtained, not through $object->relationships, but another method, but it works. So the question is, should I add this extra dependency (to a module that may not continue to be compatible) and complexity for one potential very specialised use case (that could probably be done another way...any ideas...)? cheers, Bob. |