Skip to content

Commit

Permalink
Django 1.11 fixes in templatetags.
Browse files Browse the repository at this point in the history
  • Loading branch information
audaciouscode committed May 18, 2017
1 parent 27f1b93 commit e98c0c4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions templatetags/passive_data_kit.py
Expand Up @@ -25,7 +25,7 @@ def render(self, context):

context['sources'] = query

return render_to_string('tag_sources_table.html', context)
return render_to_string('tag_sources_table.html', context.flatten())


@register.tag(name="latest_point")
Expand All @@ -47,7 +47,7 @@ def render(self, context):

context['latest_point'] = source.latest_point()

return render_to_string('tag_latest_point.html', context)
return render_to_string('tag_latest_point.html', context.flatten())


@register.tag(name="point_count")
Expand Down Expand Up @@ -119,7 +119,7 @@ def render(self, context):
context['value'] = value
context['tooltip'] = tooltip

return render_to_string('tag_point_hz.html', context)
return render_to_string('tag_point_hz.html', context.flatten())

@register.tag(name="to_hz")
def to_hz(parser, token): # pylint: disable=unused-argument
Expand Down Expand Up @@ -168,7 +168,7 @@ def render(self, context):
context['value'] = value
context['tooltip'] = tooltip

return render_to_string('tag_point_hz.html', context)
return render_to_string('tag_point_hz.html', context.flatten())

@register.tag(name="date_ago")
def date_ago(parser, token): # pylint: disable=unused-argument
Expand Down Expand Up @@ -209,7 +209,7 @@ def render(self, context):
context['ago'] = ago_str
context['date'] = date_obj

return render_to_string('tag_date_ago.html', context)
return render_to_string('tag_date_ago.html', context.flatten())


@register.tag(name="human_duration")
Expand Down Expand Up @@ -244,7 +244,7 @@ def render(self, context):
context['human_duration'] = ago_str
context['seconds'] = seconds_obj

return render_to_string('tag_human_duration.html', context)
return render_to_string('tag_human_duration.html', context.flatten())


@register.tag(name="generators_table")
Expand All @@ -266,7 +266,7 @@ def render(self, context):

context['source'] = source

return render_to_string('tag_generators_table.html', context)
return render_to_string('tag_generators_table.html', context.flatten())


@register.tag(name="generator_label")
Expand All @@ -288,4 +288,4 @@ def render(self, context):

context['source'] = source

return render_to_string('tag_generators_table.html', context)
return render_to_string('tag_generators_table.html', context.flatten())

0 comments on commit e98c0c4

Please sign in to comment.