diff options
author | Esteban Bordon <ebordon@plan.ceibal.edu.uy> | 2012-05-02 13:01:35 (GMT) |
---|---|---|
committer | Esteban Bordon <ebordon@plan.ceibal.edu.uy> | 2012-05-02 13:01:35 (GMT) |
commit | 2a3ac4519467e99cdaf6c396c7c3c5e732216072 (patch) | |
tree | c0cfd0b9adda4b73f981c3a15baf32e0c31a6b15 | |
parent | 2a1c0c4d6bbbe58452c38db900c89955d0f1c839 (diff) |
cambios en store.py
-rw-r--r-- | store.py | 21 |
1 files changed, 11 insertions, 10 deletions
@@ -79,16 +79,17 @@ class Db: order = "ASC" else: order = "DESC" - mappedValue = "type" - if value == "Tipo": - mappedValue = "type" - elif value == "Prioridad": - mappedValue = "priority" - elif value == "Lanzamiento": - mappedValue = "launched" - elif value == u"Expiración": - mappedValue = "expires" - query = "select distinct " + mappedValue + " from notifications order by type " + order + value = value.lower() + mapped_value = "type" + if value == "tipo": + mapped_value = "type" + elif value == "prioridad": + mapped_value = "priority" + elif value == "lanzamiento": + mapped_value = "launched" + elif value == u"expiración": + mapped_value = "expires" + query = "select distinct %s from notifications order by %s %s " %(mapped_value, mapped_value, order) return map(lambda x:x[mappedValue],self.run_query(query)) def set_fav(self, id_msg, fav=True): |