<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,18 +1,20 @@
-$def with (items, what)
+$def with (items, what, name)
 
 $var width: 90%
 $var color: white
 
-$var title: Distribution of $what
+$var title: Distribution of $(name or what)
 
 
-&lt;h1&gt;Distribution of $what&lt;/h1&gt;
+&lt;h1&gt;Distribution of $(name or what)&lt;/h1&gt;
 
 &lt;ol class=&quot;chartlist&quot;&gt;
 $for item in items:
     &lt;li id=&quot;$item.id&quot;&gt;
       &lt;a href=&quot;$item.path&quot;&gt;$item.name&lt;/a&gt;
-      &lt;span class=&quot;count&quot;&gt;$item[what]&lt;/span&gt;
+      &lt;span class=&quot;count&quot;&gt;$item[what] 
+          $if what.startswith('pct_'): %
+      &lt;/span&gt;
       &lt;span class=&quot;index&quot; style=&quot;width: $abs(int(item.pct))%&quot;&gt;&lt;/span&gt;
     &lt;/li&gt;
 &lt;/ol&gt;
\ No newline at end of file</diff>
      <filename>templates/dproperty.html</filename>
    </modified>
    <modified>
      <diff>@@ -611,6 +611,24 @@ class politician_group:
 r_safeproperty = re.compile('^[a-z0-9_]+$')
 table_map = {'us': 'district', 'p': 'politician'}
 
+def namesmap():
+    d = {}
+    cols = [cname for cname, c in schema.Politician.columns.items() if c.sql_type in ('real', 'int')]
+    prefix_map = dict(n_='number of &lt;&gt;', pct_='money from &lt;&gt;', amt_='amount of &lt;&gt;')
+    for c in cols:
+        for prefix in prefix_map:
+            if c.startswith(prefix):
+                x = web.lstrips(c, prefix).split('_')
+                if x[0] in ('earmark', 'vote', 'bill', 'smalldonor'): x[0] += 's' #make plural
+                if c == 'pct_spent':
+                    d[c] = 'money spent'
+                else:
+                    d[c] = prefix_map[prefix].replace('&lt;&gt;', ' '.join(x))
+    for c in cols:
+        if c not in d:
+            d[c] = c.replace('_', ' ')
+    return d
+
 class dproperty:
     def GET(self, table, what):
         try:
@@ -641,7 +659,7 @@ class dproperty:
                 item.name = '%s %s (%s%s)' % (item.firstname, item.lastname,
                   (item.party or 'I')[0], state)
                 item.path = '/p/' + item.id
-        return render.dproperty(items, what)
+        return render.dproperty(items, what, namesmap().get(what))
 
 def sparkpos(table, what, id):
     if table == 'district':</diff>
      <filename>webapp.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>05621943e3237f933e0c4654830c6ddf961f6dc4</id>
    </parent>
  </parents>
  <author>
    <name>Devi</name>
    <email>asldevi@gmail.com</email>
  </author>
  <url>http://github.com/aaronsw/watchdog/commit/0c5bd359f015a407d5fa72a65dbe8fd6375639b0</url>
  <id>0c5bd359f015a407d5fa72a65dbe8fd6375639b0</id>
  <committed-date>2009-03-24T04:45:30-07:00</committed-date>
  <authored-date>2009-03-24T04:35:20-07:00</authored-date>
  <message>better titles for /p/by/&lt;xxx&gt; pages; differentiate between pct and amt</message>
  <tree>426dbbaf2ddd15333c727496664d1c099c35aa22</tree>
  <committer>
    <name>Devi</name>
    <email>asldevi@gmail.com</email>
  </committer>
</commit>
