Eliminado un groupby que me falla en mi servidor
authordanigm <dani@danigm.net>
Thu, 12 Nov 2009 23:09:57 +0000 (00:09 +0100)
committerdanigm <dani@danigm.net>
Thu, 12 Nov 2009 23:09:57 +0000 (00:09 +0100)
templates/purchase.html
view/items.py

index 80586bd..22b3d64 100644 (file)
@@ -1,4 +1,4 @@
-$def with (year, chart, purchases, years)
+$def with (year, chart, purchases)
 
 $var title: Compras del $year
 $var cssfiles: /static/css/list.css /static/css/purchase.css
@@ -12,10 +12,9 @@ $var cssfiles: /static/css/list.css /static/css/purchase.css
 </div>
 
 <div id="links">
-    $for i in years:
-        <a href="/purchase/$i.atime.year">$i.atime.year</a>
-        $if not loop.last:
-            |
+    <a href="/purchase/$(year-1)">$(year-1)</a>
+    <a href="/purchase">Actual</a>
+    <a href="/purchase/$(year+1)">$(year+1)</a>
 </div>
 
 <div id="add">
index 1c10728..e5e5348 100644 (file)
@@ -117,14 +117,12 @@ class Purchase:
             if x:
                 purchases.append((m, x, all2))
 
-        years = orm.query(db.Purchase).group_by(db.extract('year', db.Purchase.atime)).all()
-            
         directory = 'static/charts/'
         #for i in os.listdir(directory):
         #    os.remove(directory+i)
         chart = directory + "chart%d.png" % random.randint(1,100)
         barchar.create_chart(chart, data)
         
-        return web.ctx.render.purchase(y, chart, purchases, years)
+        return web.ctx.render.purchase(y, chart, purchases)