title: Dynamic properties for CanJS model?
body: <p>I would like to add dynamic properties in my model that is not in the REST service results. These dynamic properties would shorten names, format dates, etc. For example, my CanJS model like this:</p>
  
  <pre><code>var MyModel = can.Model({
      findAll: 'GET /Services/all'),
      findOne: 'GET /Services/{id}'),
      create:  'POST /Services/all'),
      update:  'PUT /Services/{id}'),
      destroy: 'DELETE /Services/{id}')
  }, {});
  </code></pre>
  
  <p>Then I retrieve the data like this:</p>
  
  <pre><code>MyModel.findAll({}, function(data) {
      $('#main').html(can.view('templates/List.ejs'), data));
  });
  </code></pre>
  
  <p>And this is how my List.ejs template looks like:</p>
  
  <pre><code>&lt;% for(var i = 0; i &lt; this.length; i++) { %&gt;
      &lt;div class="thumb"&gt;&lt;img src="http://cdn.somewhere.com/images/logo.&lt;%= this[i].BaseName %&gt;.png" /&gt;&lt;/div&gt;
      &lt;div class="title"&gt;&lt;%= this[i].Name %&gt;&lt;/div&gt;
      &lt;div class="date"&gt;&lt;%= moment(this[i].StartDate).format('MMM DD, YYYY') %&gt; - &lt;%= moment(this[i].EndDate).format('MMM DD, YYYY') %&gt;&lt;/div&gt;
      &lt;div class="location"&gt;&lt;%= this[i].LocationFriendly %&gt;&lt;/div&gt;
      &lt;div class="description"&gt;&lt;%= this[i].Description %&gt;&lt;/div&gt;
  &lt;% } %&gt;
  </code></pre>
  
  <p>Notice the logic I am doing in the template for the image src and start/end dates. I would like to put this logic in the model so all I have to do in the template is this:</p>
  
  <pre><code>&lt;% for(var i = 0; i &lt; this.length; i++) { %&gt;
      &lt;div class="thumb"&gt;&lt;img src="&lt;%= this[i].ImageURL %&gt;" /&gt;&lt;/div&gt;
      &lt;div class="title"&gt;&lt;%= this[i].Name %&gt;&lt;/div&gt;
      &lt;div class="date"&gt;&lt;%= this[i].StartDateFriendly %&gt; - &lt;%= this[i].EndDateFriendly %&gt;&lt;/div&gt;
      &lt;div class="location"&gt;&lt;%= this[i].LocationFriendly %&gt;&lt;/div&gt;
      &lt;div class="description"&gt;&lt;%= this[i].Description %&gt;&lt;/div&gt;
  &lt;% } %&gt;
  </code></pre>
  
  <p>How to I move this logic into the model layer or any better place then the template? Thanks for any help or advise.</p>