forgot te reply to all . ---------- Forwarded message ---------- From: Peter Speltz <[EMAIL PROTECTED]> Date: Nov 8, 2005 10:45 AM Subject: Re: [Maypole-devel] Maypole and model class without table To: Aaron Trevena <[EMAIL PROTECTED]>
On 11/8/05, Aaron Trevena <[EMAIL PROTECTED]> wrote: > On 11/8/05, Peter Speltz <[EMAIL PROTECTED]> wrote: > > Maypole tries to fetch_objects for the model_class every request. > > This is not good say if the model_class does not correspont to a > > table. Here is a patch for Maypole::Model::CDBI fetch_objects so it > > wont fetch objects unless the class has primary columns. > > > > [ code snipped ] > > > > I was just experimenting with making my custom $r->config->model base > > class which does not have a table associated with it. execute an > > action. With this patch an override of "class_of" I can say: > > > > localhost/model_class/quick_search > > > > It is desireable to be able to have actions in classes without tables > > and have uri s map to classes without tables. > > email can be so much clearer than irc logs sometimes - looking at this > now I think the better solution would be to have an option when > setting up or specifying a table that it has no options, then rather > than relying on not having a primary key (something non-cdbi models > like svn, ldap etc won't require) it checks whether the 'table' has > objects. > > anybody elses thoughts? > I did not mean that this should be the only way to set up a class with no table. Just that you should not fetch objects if there is no Pks . I posted somewhere, oh yeah, my demo, the Source class -- a tableless class example and the struggles i had to do to make it work. That is without the above hack. I think we need a NoTable base class for these to inherit from. Maypole::Model::NoTable or something. see source of Source.pm at http://doorstop.cafes.net:1088/maytech/source/Source/ -- pjs ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Maypole-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maypole-devel
