Re: Model Q: HABTM association the right way to go?

2009-03-02 Thread TGurske
Thanks for your help. From your example I was able to find this page: http://book.cakephp.org/view/84/Saving-Related-Model-Data-hasOne-hasMany-belongsTo which I never noticed before for some reason. It was helpful too but the validation always gives an error but I can fix that another time. Anywa

Re: Model Q: HABTM association the right way to go?

2009-03-02 Thread mscdex
On Mar 2, 12:33 pm, TGurske wrote: > That seems to work but how do I get it to make a new id in the > location table? In 'Location.0.name' I think it's trying to insert it > into id '0'. If the Location table has an autoincrementing ID field and you do have the user enter the ID on the form, the

Re: Model Q: HABTM association the right way to go?

2009-03-02 Thread TGurske
That seems to work but how do I get it to make a new id in the location table? In 'Location.0.name' I think it's trying to insert it into id '0'. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To pos

Re: Model Q: HABTM association the right way to go?

2009-02-26 Thread mscdex
On Feb 27, 12:11 am, TGurske wrote: > I guess that makes sense. > > What I need is that input to add a new location. Is there a way to do > that? I tried "Location.location" (instead of location_id) but it > doesn't work. If you're adding a new Location to be associated with the record, (dependi

Re: Model Q: HABTM association the right way to go?

2009-02-26 Thread TGurske
I guess that makes sense. What I need is that input to add a new location. Is there a way to do that? I tried "Location.location" (instead of location_id) but it doesn't work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Model Q: HABTM association the right way to go?

2009-02-26 Thread mscdex
On Feb 26, 10:36 pm, TGurske wrote: > That's how I initially set up the tables but when I baked it the bake > defaults reversed everything - so all my edit views would give me a > drop down list of location id's. It used belongsTo in the main tables > and then hasOne and hasMany in the location t

Re: Model Q: HABTM association the right way to go?

2009-02-26 Thread TGurske
That's how I initially set up the tables but when I baked it the bake defaults reversed everything - so all my edit views would give me a drop down list of location id's. It used belongsTo in the main tables and then hasOne and hasMany in the location table. So what should I use in the model? --~

RE: Model Q: HABTM association the right way to go?

2009-02-26 Thread Steven Wright
Behalf Of Tim Sent: Thursday, February 26, 2009 10:11 PM To: CakePHP Subject: Model Q: HABTM association the right way to go? I'm not new to cake but I've never gotten into the associations and I'm a little bit confused: I have several tables: - Projects - Systems - Organizatio

Model Q: HABTM association the right way to go?

2009-02-26 Thread Tim
I'm not new to cake but I've never gotten into the associations and I'm a little bit confused: I have several tables: - Projects - Systems - Organizations - Volunteers - Students - Computers - Divisions and - Location Each table will be able to have a location so they all have a "location_id" f