Skip to content

Commit

Permalink
patching new bugs in overview.py
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffroy-noel-ddh committed Aug 20, 2017
1 parent ebaa3b7 commit 687d7ea
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions digipal/views/faceted_search/overview.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ def get_records(self):

def get_count(self):
records = self.get_records()
return records.count()
if isinstance(records, list):
ret = len(records)
else:
ret = records.count()
return ret

def get_summary(self):
ret = 'Summary for query %s' % self.index
Expand Down Expand Up @@ -527,7 +531,7 @@ def set_fields(self, faceted_search):
'vcat', True) and (not possible_categories or field['key'] in possible_categories)]

category_field = faceted_search.get_field_by_key(
self.request.REQUEST.get('vcat', 'hi_type'))
utils.get_request_var(self.request, 'vcat', 'hi_type'))
if category_field is None:
category_field = faceted_search.get_field_by_key('hi_type')
if category_field is None:
Expand Down Expand Up @@ -642,8 +646,8 @@ def reframe(self):
# reframe the x values based on min date
for point in points:
if point[0] is not None:
point[0][0] -= self.mins[0]
point[0][1] -= self.mins[0]
point[0][0] -= self.mins[0] or 0
point[0][1] -= self.mins[0] or 0
# reframe the histograms
#self.histogram = {x - self.mins[0]: hist for x, hist in self.histogram.iteritems()}
histogram = self.histogram
Expand Down

0 comments on commit 687d7ea

Please sign in to comment.