title: In bookshelf.js, I don't understand how to retrieve attribute from targets in hasOne() relationship for my template
body: <p>I have a task object, the belongs to a job object.  It is a belongsTo() relationship, but I'm using a hasOne() relationship because I just couldn't figure out belongsTo().</p>
  
  <p>My models are:</p>
  
  <pre><code>var job = Bookshelf.Model.extend({
      tableName: 'jobs',
      idAttribute: 'id'
  });
  
  var task = Bookshelf.Model.extend({
      tableName: 'tasks',
      idAttribute: 'id',
      job: function() {
          return this.hasOne(Job);
      },
      job_summary: function() {
          return this.job().fetch().get('summary');
      }
  });
  </code></pre>
  
  <p>I've tried a few combinations of the .job_summary() function, but nothing seems to work.  When I create a task object, I just want to be able to get the job summary of the related task, like:</p>
  
  <pre><code>var task_jobsummary = task.job_summary();
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>EDIT:  I actually have 2 hasOne() targets I need to get data for.</p>
  
  <p>EDIT:  I think my problem is not understanding promises.  If I were doing this in PHP, I'd do something like:</p>
  
  <pre><code>$myvar = stdClass();
  $myvar-&gt;somefield = $task-&gt;getSomefield();
  $myvar-&gt;anotherfield = $task-&gt;getAnotherField();
  $myvar-&gt;jobfield = $job-&gt;getSomeJobField();
  // ... etc
  </code></pre>
  
  <p>I want to simple return values from a then() after a fetch().</p>
  
  <p>EDIT: Here is my code from my router:</p>
  
  <pre><code>var route_task(req, res, next) {
      res.locals.username = 'debug_username';
      res.locals.userpic = '/img/tmpuserpic.png';
  
      new Model.Task().fetch({id: req.params.id, withRelated: ['job']})
      .then(function(task) {
          task.related('job').fetch().then(function(job) {
              res.locals.somefield = job.get('somefield');
          });
      })
      .then(function() {
          res.render('task');
      })
  }
  </code></pre>
  
  <p>The two vars before the Model are set, and my template sees them.  However, the template doesn't see the res.locals.somefield setting.</p>