<br><br><div><span class="gmail_quote">On 8/8/06, <b class="gmail_sendername">Jonas</b> <<a href="mailto:jonas.alves@gmail.com">jonas.alves@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Maybe $c->model should return the DBIC model schema if it founds one.<br>That way if you have a DBIC Model schema named MyApp::Model::Foo and<br>want to get the Bar resultset you just have to write<br>$c->model->resultset('Bar') instead of
<br>$c->model('Foo')->resultset('Bar'). I know that you can write<br>$c->model('Foo::Bar'); but the other form is useful if you don't know<br>the model name. In the new instantCRUD it's possible to define the<br>
model name in the helper but than i don't know what name the user as<br>chosen so i can't have it hardcoded in the base controllers. What i<br>did to circumvent that was to write the model name in the generated<br>app config.
</blockquote><div><br>Well, the <a href="http://Catalyst.pm">Catalyst.pm</a> code can't be specific to the DBIC Schema model. There are many other models out there for Cat, some of which have nothing to do with databases. About the only way to make such a thing work out well would be to add a peice of class/instance data to each model that indicates whether it is a "submodel" of some other model or not. Then models like DBIC::Schema could set this flag on the resultset pseudo-models to exclude them from the search process for $c->model. It all seems like too much effort in the name of too little useful magic to me, but that's up to everyone else.
<br><br>-- Brandon<br> </div><br></div>