Skip to content

Commit

Permalink
Turning HTML into a context aware field.
Browse files Browse the repository at this point in the history
Now we can do things like HTML('{% if form.errors %}<p>Whatever</p>{% endif %}')
  • Loading branch information
maraujop committed Apr 10, 2011
1 parent 7933078 commit cac219f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions uni_form/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
import logging
import sys

from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
from django.forms.forms import BoundField
from django.template import Context, Template
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.conf import settings


class FormHelpersException(Exception):
Expand Down Expand Up @@ -288,8 +289,7 @@ def __init__(self, html):
self.html = unicode(html)

def render(self, form):
return self.html

return Template(self.html).render(Context({'form': form}))

class FormHelper(object):
"""
Expand Down

0 comments on commit cac219f

Please sign in to comment.