]> asedeno.scripts.mit.edu Git - bluechips.git/commitdiff
Tweak tag implementation
authorAlejandro R. Sedeño <asedeno@mit.edu>
Sun, 18 Apr 2010 20:58:24 +0000 (16:58 -0400)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Wed, 23 Feb 2011 02:39:20 +0000 (21:39 -0500)
We should not be using c.values to store tags; put them in c.tags
instead.

bluechips/controllers/spend.py
bluechips/templates/spend/index.mako

index 3a17d2b4f48335a4dc425affc4a4516f5c3b45c2..e7952a893dcae0b0a8fa541b24d9d4e6110cd9fe 100644 (file)
@@ -101,7 +101,7 @@ class SpendController(BaseController):
                 user_id, user = user_row
                 c.values['shares-%d.amount' % ii] = 1 if user.resident else ""
 
-            c.values['tags'] = u""
+            c.tags = u""
         else:
             c.title = 'Edit an Expenditure'
             c.expenditure = meta.Session.query(model.Expenditure).get(id)
@@ -115,7 +115,7 @@ class SpendController(BaseController):
                 share = shares_by_user.get(user, '')
                 c.values['shares-%d.amount' % ii] = share
 
-            c.values['tags'] = ', '.join(c.expenditure.tags)
+            c.tags = ', '.join(c.expenditure.tags)
 
         return render('/spend/index.mako')
 
index 9db5cb8804bd12041f658486f2b8488554507dc2..d4064cb58e914a3808e6daf92aa5d33de85cf32c 100644 (file)
@@ -21,7 +21,7 @@
     </tr>
     <tr>
       <th><label for="tags">Tags</label></th>
-      <td>${h.text('tags', c.values['tags'], size=64)}</td>
+      <td>${h.text('tags', c.tags, size=64)}</td>
     </tr>
   </table>