[Maypole] Using model class methods in addnew

Peter Speltz peterspeltz@yahoo.com
Wed, 13 Oct 2004 11:09:55 -0700 (PDT)


--- Simon Cozens <simon@simon-cozens.org> wrote:

> Peter Speltz:
> > beer.mymethod. There is no object beer yet.  However it would be nice to
> call
> > BeerDB::Beer methods anytime your working with beer.  
> 
> [% USE beer_class = Class("BeerDB::Beer"); beer_class.foo %]
> 
> -- 

This isn't working. If it did it would be an ok solution. However i'd prefer
not to have to say that so i added a experimental line to 
Maypole::Model::Base's process function right after getting the class and $r. 

# make a dumb class obj to call methods with in templates.
$r->{template_args}{dumb_obj} = bless {},  $class;
#

Well when , i print [%dumb_obj%] in the template i get "MyApp::Customer" which
is the class i want but working on but calling 
calling a method with it doesn't work. Any ideas, please :) ?

My real maypole question here is Why not have a dumb object by default? 

The other why the hell doesn't what Simon said work for me. I think there's a
plugin i may need.  Let me go look for it.  


> The use of COBOL cripples the mind; its teaching should, therefore, be
> regarded as a criminal offence.
> 		-- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5
> 
> _______________________________________________
> maypole mailing list
> maypole@lists.netthink.co.uk
> http://lists.netthink.co.uk/listinfo/maypole
> 


=====
pjs

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com