Skip to content

Commit

Permalink
Merge pull request #14 from CodeForAfrica/fix-total-desc
Browse files Browse the repository at this point in the history
[Bug] Fix get_stat_data ordering by descending total
  • Loading branch information
kilemensi committed Aug 5, 2019
2 parents 3275ae7 + a47e033 commit 4d3af6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
'django-pipeline>=1.6.4',
'django-sass-processor>=0.5.4',
'ecdsa>=0.11',
'futures>=3.0.4',
'libsass>=0.13.1',
'paramiko>=1.12.3,<2',
'psycopg2>=2.5.2',
Expand Down
4 changes: 2 additions & 2 deletions wazimap/models/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from itertools import groupby
from wazimap.data.base import Base
from wazimap.data.utils import get_session, capitalize, percent as p, add_metadata, current_context
from sqlalchemy import Column, String, Table, or_, and_, func
from sqlalchemy import Column, String, Table, or_, and_, func, text
from sqlalchemy.exc import NoSuchTableError
from sqlalchemy.orm import class_mapper
import sqlalchemy.types
Expand Down Expand Up @@ -855,7 +855,7 @@ def get_rows_for_geo(self, geo, session, fields=None, order_by=None, only=None,

if attr == 'total':
if is_desc:
attr = attr + ' DESC'
attr = text(attr + ' DESC')
else:
attr = getattr(db_model, attr)
if is_desc:
Expand Down

0 comments on commit 4d3af6c

Please sign in to comment.