orders: just sort customer's contacts higher in contacts list, instead of hiding others
authorTero Marttila <terom@fixme.fi>
Fri, 31 Dec 2010 02:46:22 +0200
changeset 29 9c7ddcaa2e90
parent 28 1bfe14d74dcf
child 30 97d5d37333d2
orders: just sort customer's contacts higher in contacts list, instead of hiding others
svv/orders.py
--- a/svv/orders.py	Fri Dec 31 02:32:52 2010 +0200
+++ b/svv/orders.py	Fri Dec 31 02:46:22 2010 +0200
@@ -580,7 +580,7 @@
         sql = db.select([db.contacts.c.id, db.contacts.c.name, db.contacts.c.phone, db.contacts.c.email])
 
         if customer_id :
-            sql = sql.where((db.contacts.c.customer_id == customer_id))
+            sql = sql.order_by((db.contacts.c.customer_id == customer_id))
 
         return self.app.query(sql)