Permalink
Browse files

Bad path for render_to_string

  • Loading branch information...
David Cramer David Cramer
David Cramer authored and David Cramer committed Nov 13, 2009
1 parent 6715ac5 commit bc2f880cf9cfc74c59a9392948c355c4c76733b8
Showing with 4 additions and 1 deletion.
  1. +3 −0 django_histograms/templatetags/histograms.py
  2. +1 −1 django_histograms/utils.py
@@ -1,9 +1,12 @@
from django_histograms.utils import Histogram
from django import template
+from django.db.models import get_model
register = template.Library()
def histogram_for(model, attname):
+ if isinstance(model, basestring):
+ model = get_model(*models.split('.'))
return Histogram(model, attname).render(css=True)
register.simple_tag(histogram_for)
@@ -3,7 +3,7 @@
from django.utils.safestring import mark_safe
from django.db.models import Count
-from django.shortcuts import render_to_string
+from django.template.loader import render_to_string
HISTOGRAM_CSS = """

0 comments on commit bc2f880

Please sign in to comment.