Thoughts on a CDBI::AsForm::_to_new()

[prev] [thread] [next] [Date index for 2004/10/21]

From: Peter Speltz
Subject: Thoughts on a CDBI::AsForm::_to_new()
Date: 16:07 on 21 Oct 2004
In forms, often I want my has_a relationships to expand into inputs for each
column in the has a class. Now, has_a classes are just made into select boxes. 

I'd like a _to_new() sub which would turn has_a 's into inputs for each column
in the class and just the default text input for non has_a columns.

My employee has a address, username_password, email_addr, phone_num, and
person.

It would be nice if in my new employee template, i could say:
[% SET how = "new" %]
[% USE employee = Class("CDBI::Employee") %]
[% FOR col IN employee.columns
	# Make new inputs for every part of employee
	employee->to_field(column, how); # returns result from _to_new()
[% END %]

To me AsForm seems like the place to put this.  I don't know. Maybe its
overkill.  

=====
pjs


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

Thoughts on a CDBI::AsForm::_to_new()
Peter Speltz 16:07 on 21 Oct 2004

Re: Thoughts on a CDBI::AsForm::_to_new()
Tony Bowden 14:20 on 24 Oct 2004

Re: Thoughts on a CDBI::AsForm::_to_new()
Andreas Fromm 07:14 on 25 Oct 2004

Re: Thoughts on a CDBI::AsForm::_to_new()
Peter Speltz 20:37 on 25 Oct 2004

Re: Thoughts on a CDBI::AsForm::_to_new()
Andreas Fromm 07:51 on 26 Oct 2004

Re: Thoughts on a CDBI::AsForm::_to_new()
Peter Speltz 22:58 on 05 Nov 2004

Re: Thoughts on a CDBI::AsForm::_to_new()
Clayton Scott 05:51 on 03 Nov 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52