Re: Associated model won't load

2010-02-18 Thread John Andersen
Hmm, could have been the model cache maybe :) Well, good that it seems solved! Enjoy, John On Feb 18, 6:03 am, Furuno furunom...@gmail.com wrote: Well, yesterday, I try to re-create the app and database from scracth, copy paste the code again, and, for some reason... it works... and now I

Re: Associated model won't load

2010-02-17 Thread John Andersen
I can give it a try in my development site, if you would like me to try! Probably only need the two controllers with models! John On Feb 17, 9:13 am, Furuno furunom...@gmail.com wrote: Okay somebody please tell me that this is some kind of mystical phenomenon : yeah, I've tried using

Associated model won't load

2010-02-16 Thread Furuno
Okay, so, I have two models called Program and Subject, here's the classes : program.php ?php class Program extends AppModel { var $hasMany = 'Subject'; } ? subject.php ?php class Subject extends AppModel { var $belongsTo = 'Program' } ? And the controllers :

Re: Associated model won't load

2010-02-16 Thread andy
Does it work if you try doing a $this-Subject-find() instead of using paginate? Just to see if that works... On Feb 16, 9:37 am, Furuno furunom...@gmail.com wrote: Okay, so, I have two models called Program and Subject, here's the classes : program.php ?php class Program extends AppModel

Re: Associated model won't load

2010-02-16 Thread Furuno
Nope... :( Just to make sure, I tried that once again with : $this-set('subjects', $this-Subject-find('all')); still no luck... On 17 Feb, 00:56, andy sum...@gmail.com wrote: Does it work if you try doing a $this-Subject-find() instead of using paginate?  Just to see if that works... On Feb

Re: Associated model won't load

2010-02-16 Thread andy
Do you know what version of CakePHP you are running? On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote: Nope... :( Just to make sure, I tried that once again with : $this-set('subjects', $this-Subject-find('all')); still no luck... On 17 Feb, 00:56, andy sum...@gmail.com wrote:

Re: Associated model won't load

2010-02-16 Thread Furuno
1.2.6... On 17 Feb, 01:57, andy sum...@gmail.com wrote: Do you know what version of CakePHP you are running? On Feb 16, 10:00 am, Furuno furunom...@gmail.com wrote: Nope... :( Just to make sure, I tried that once again with : $this-set('subjects', $this-Subject-find('all')); still

Re: Associated model won't load

2010-02-16 Thread John Andersen
Are you missing a semicolon in this code? [code] ?php class Subject extends AppModel { var $belongsTo = 'Program' } ? [/code] just after 'Program' ? or was it a type in the post :) Enjoy, John On Feb 16, 9:01 pm, Furuno furunom...@gmail.com wrote: 1.2.6... On 17 Feb, 01:57, andy

Re: Associated model won't load

2010-02-16 Thread Furuno
well, I'm afraid it's only in the post... On 17 Feb, 02:38, John Andersen j.andersen...@gmail.com wrote: Are you missing a semicolon in this code? [code] ?php class Subject extends AppModel {         var $belongsTo = 'Program'} ? [/code] just after 'Program' ? or was it a type in the

Re: Associated model won't load

2010-02-16 Thread John Andersen
Damn :) Ok, have you tried adding the uses variable? [code] var $uses = array('Subject'); [/code] in the Subjects controller! John On Feb 16, 9:49 pm, Furuno furunom...@gmail.com wrote: well, I'm afraid it's only in the post... On 17 Feb, 02:38, John Andersen j.andersen...@gmail.com

Re: Associated model won't load

2010-02-16 Thread Furuno
tried that too... still no luck... Really, I think I've exhausted a lot of methods already but still can't fix it... On 17 Feb, 03:09, John Andersen j.andersen...@gmail.com wrote: Damn :) Ok, have you tried adding the uses variable? [code]    var $uses = array('Subject'); [/code] in the

Re: Associated model won't load

2010-02-16 Thread John Andersen
Have you checked that the Subject model filename is subject.php? And the model is named Subject not subject? Just trying to throw something around, which usually creates these kind of problems :) Maybe copy/paste the Subject model into a post! John On Feb 16, 10:20 pm, Furuno

Re: Associated model won't load

2010-02-16 Thread Furuno
Well, actually, yes... :) To make sure that everything runs fine, I'm actually creating the refinements of my final prototype application (an online exam system), and I've obviously copy paste anything from the protype code, the new stuff here is just pagination. I've tried removing pagination

Re: Associated model won't load

2010-02-16 Thread John Andersen
I assume that you are not using the Containable behaviour, so my last suggestion is - have a look at the Containable behaviour, I use it myself and it saved a lot of time when I want to be sure that I retrieve not only one model but also associated models from up to several levels of associations.

Re: Associated model won't load

2010-02-16 Thread Furuno
WIll try once I got to back to my office (it's 6.30 AM currently)... thanks! On 17 Feb, 03:58, John Andersen j.andersen...@gmail.com wrote: I assume that you are not using the Containable behaviour, so my last suggestion is - have a look at the Containable behaviour, I use it myself and it

Re: Associated model won't load

2010-02-16 Thread Furuno
Okay somebody please tell me that this is some kind of mystical phenomenon : yeah, I've tried using containable behaviors, not using pagination, not using admin routes, redownload the cakephp library, reinstalling apache and mysql, and anything I can think about other that reinstall the OS and