Re: [Maypole] Using model class methods in addnew

From: Marcus Ramberg (marcus at thefeed.no)
Date: Wed Oct 13 2004 - 16:20:34 BST


Hi Peter.

Try classmetadata.name.<method> ?

Marcus

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 at lists.netthink.co.uk
>http://lists.netthink.co.uk/listinfo/maypole
>
>

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT