Re: hasMany & hasOne problem

2008-05-12 Thread deeps
Thx adam, working perfectly Regards, On May 3, 3:43 am, Adam Royle <[EMAIL PROTECTED]> wrote: > As long as you have var $belongsTo = array('Author'); in your Comment > model, just set recursive to a higher value. > > $this->Post->recursive = 2; > $posts = $this->Post->findAll(); > > Cheers, > Ad

Re: hasMany & hasOne problem

2008-05-02 Thread Adam Royle
As long as you have var $belongsTo = array('Author'); in your Comment model, just set recursive to a higher value. $this->Post->recursive = 2; $posts = $this->Post->findAll(); Cheers, Adam On May 3, 3:40 am, deeps <[EMAIL PROTECTED]> wrote: > Ok, i m trying cakephp for one of my application, ti

hasMany & hasOne problem

2008-05-02 Thread deeps
Ok, i m trying cakephp for one of my application, till now no errors are there & cakephp is making life easy but now i am stuck in one simple problem I am having these tables in database Post -id (PK) -title -description Comment -id (PK) -comment -post_id (FK) -author_id (FK) Author -id (

Re: hasOne Problem

2007-05-23 Thread Jon Bennett
> hm.. > i want to print out all projects and instead of the project.status_id, > i want to show the status.title provided you setup you models correctly, eg: Project belongsTo Status Status hasMany Project // in your ProjectsController $this->Project->recursive = 1; $projects = $this->Project

Re: hasOne Problem

2007-05-23 Thread John David Anderson (_psychic_)
On May 23, 2007, at 4:21 PM, pete wrote: > > hm.. > i want to print out all projects and instead of the project.status_id, > i want to show the status.title > > how could i do that? If Project belongsTo Status: $projects = $this->Project->findAll(); foreach($projects as $project) { ec

Re: hasOne Problem

2007-05-23 Thread pete
hm.. i want to print out all projects and instead of the project.status_id, i want to show the status.title how could i do that? thanks pete On May 23, 5:29 pm, "John David Anderson (_psychic_)" <[EMAIL PROTECTED]> wrote: > On May 23, 2007, at 3:21 PM, pete wrote: > > > > > hi, > > i have prob

Re: hasOne Problem

2007-05-23 Thread John David Anderson (_psychic_)
On May 23, 2007, at 3:21 PM, pete wrote: > > hi, > i have problems using hasOne > basically i want to achieve: a project hasOne status > > TABLES > projects > id > title > status_id > > statuses > id > title The way you have things keyed here, its actually Status hasOne Project (and

hasOne Problem

2007-05-23 Thread pete
hi, i have problems using hasOne basically i want to achieve: a project hasOne status TABLES projects id title status_id statuses id title class Project extends AppModel { var $name='Project'; var $hasOne = array('Status' => array('className' => 'Status', 'conditions'