title: Sails.js Set model value with value from Callback
body: <p>i need to provide something like an association in my Model. So I have a Model called Posts with an userid and want to get the username from this username and display it.</p>
  
  <p>So my ForumPosts.js Model looks like the following:</p>
  
  <pre><code>module.exports = {
  
    schema: true,
  
    attributes: {
  
      content: {
          type: 'text',
          required: true
      },
  
      forumTopicId: {
          type: 'text',
          required: true
      },
  
      userId: {
        type: 'integer',
        required: true
      },
  
      getUsername: function(){
        User.findOne(this.userId, function foundUser(err, user) {
          var username =  user.username;
        });
        console.log(username);
        return username;
      }
    }
  
  };
  </code></pre>
  
  <p>I know that this return will not work because it is asynchronus... But how can i display it in my view? At the Moment i retrive the value with:</p>
  
  <pre><code>&lt;%= forumPost.getUsername() %&gt;
  </code></pre>
  
  <p>And for sure get an undefined return...</p>
  
  <p>So the question is: How can I return this value - or is there a better solution than an instanced Model?</p>
  
  <p>Thanks in advance!</p>