title: Convert one QuerySet element in all objects from int to Decimal
body: <p>I am using Django.  I'm working on a view function to try to show a list of budget transactions from my database along with other info like date, category, and a description.  (Transaction is my model, so they're Transaction objects.)  The transaction amounts are stored in integer format in the db (following some suggestions I saw here), as currency was supposedly easier to handle converting to int and back to decimal.  (Now I'm not so sure.)  I'm trying to convert back to decimal before sending the set of objects to a template for display.  I can't figure out how to pull the amount out of each Transaction object, convert it to decimal, and get it back into the objects.  I'm trying to do something like this:</p>
  
  <pre><code>object_list = Transaction.objects.all()
  
  for obj in range(0,object_list.count()):
      object_list[obj].dec_amount = Decimal(object_list[obj].amount/100).quantize(Decimal('0.01'))
  </code></pre>
  
  <p>And the template, very simple for now:</p>
  
  <pre><code>{% for item in object_list %}
  
  &lt;tr&gt;
  &lt;td&gt;{{ item.dec_amount }}&lt;/td&gt;
  &lt;td&gt;{{ item.category }}&lt;/td&gt;
  &lt;td&gt;{{ item.date }}&lt;/td&gt;
  
  &lt;/tr&gt;
  
  {% endfor %}
  </code></pre>
  
  <p>I'm basically trying to create a new dec_amount attribute in each object, but I don't know if that works.  The dec_amount is not available in my template.  I also just think there must be a more elegant way to iterate over the objects to update their amount or create a new attribute with the decimal value.  Or, maybe there's a more efficient way with pulling the QuerySet, but I don't see how I can easily keep the rows together between two queries that way.  How can I use a loop to modify one attribute in every object of a QuerySet?</p>
  
  <p>Thanks for any help.  I gotta say, I'm getting frustrated -- coming from PHP, the whole Decimal thing seems more complicated.</p>
  
  <p>EDIT:  Tried to improve my terminology a bit.</p>