[Maypole] Using model class methods in addnew

Peter Speltz peterspeltz@yahoo.com
Wed, 13 Oct 2004 08:57:33 -0700 (PDT)


--- Marcus Ramberg <marcus@thefeed.no> wrote:

> Hi Peter.
> 
> Try classmetadata.name.<method> ?
> 
> Marcus
> 

No luck.  I tried classmetadata.customer.types, request.customer.types,
request.model.types . I'm guessing its something simple like that but can't
find it in the docs. 


> Peter Speltz wrote:
> 
> >Is there a maypole way to use methods of an object your creating in the
> >"addnew' templated?  If you're in "beerdb/beer/view/1"  you can say:
> >
> >beer.mymethod to call that method.  
> >
> >But if your adding a new beer, in addnew you can't say : 
> >
> >beer.mymethod. There is no object beer yet.  However it would be nice to
> call
> >BeerDB::Beer methods anytime your working with beer.  
> >
> >Is that funtionality built into maypole?  
> >
> >If you want more clarification of my problem : 
> >I have a model class Customer.pm generated by CDBI::Loader. I added a method
> to
> >it:
> >package Namespace::Customer;
> >sub types { ('Residential', 'Business' ) }
> >
> >I want to use this method in the "addnew" template to populate a drop down
> list
> >to choose the customer type.  But i don't seem to have a Customer obj. I
> could
> >make it a driver method and probably say: request.customer_types in the
> >template but obviously it'd be it'd be better in the Customer obj.
> >
> >thanks.
> >
> >=====
> >pjs
> >
> >
> >		
> >_______________________________
> >Do you Yahoo!?
> >Declare Yourself - Register online to vote today!
> >http://vote.yahoo.com
> >
> >_______________________________________________
> >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