create_from_cgi question

[prev] [thread] [next] [Date index for 2004/11/03]

From: Peter Speltz
Subject: create_from_cgi question
Date: 22:34 on 03 Nov 2004
I want to create an object from cgi but add hash of column/values that I cannot
get from cgi to be used in creating the object.  

For an example: I have one big employee form with person, usr, and employee
fields.  employee has a prsn and usr.   So i want to say something like 

$prsn = Person->create_from_cgi($h);
$usr  = Usr->create_from_cgi($h);
# add a hash of other columns/values for this object in addition to cgi_params
employee = Employee->create_from_cgi($h, {prsn_id => $prsn, usr_id=>$usr}); ##

How do people accomplish something like this?

(currently i have this in place of 3rd line. But there has to be a better way.)
employee = Employee->create_from_cgi($h);
employee->prsn_id = $prsn;
employee->usr_id = $usr;  
employee->update;




=====
pjs


		
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 

(message missing)

create_from_cgi question
Jesse Sheidlower 14:54 on 01 Jun 2004

Re: create_from_cgi question
Tony Bowden 08:10 on 02 Jun 2004

Re: create_from_cgi question
Jesse Sheidlower 15:14 on 02 Jun 2004

Re: create_from_cgi question
Tony Bowden 15:23 on 02 Jun 2004

create_from_cgi question
Peter Speltz 22:34 on 03 Nov 2004

Re: create_from_cgi question
Tony Bowden 01:03 on 04 Nov 2004

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