# HG changeset patch # User Todd Larsen # Date 1223017391 0 # Node ID 97b60788cb9a0fd1d80f4f6dfec0ecb04de3deab # Parent 9b39d93b677fc6f6b91de1c8ed9bc7dc2a9ac5a3 Change to imports to follow the style guide: http://code.google.com/p/soc/wiki/PythonStyleGuide#Module_and_package_imports Specifically: "Use from x import y only when x is a package and y is a module." diff -r 9b39d93b677f -r 97b60788cb9a app/soc/views/helpers/custom_widgets.py --- a/app/soc/views/helpers/custom_widgets.py Fri Oct 03 01:32:34 2008 +0000 +++ b/app/soc/views/helpers/custom_widgets.py Fri Oct 03 07:03:11 2008 +0000 @@ -21,12 +21,15 @@ '"Pawel Solyga" ', ] + +import copy + from django import newforms as forms -from django.newforms.widgets import flatatt -from django.newforms.util import smart_unicode -from django.utils.html import escape +from django.newforms import util +from django.newforms import widgets +from django.utils import html from django.utils import simplejson -from django.utils.safestring import mark_safe +from django.utils import safestring class ReadOnlyInput(forms.widgets.Input): @@ -75,7 +78,7 @@ """ if value is None: value = '' - value = smart_unicode(value) + value = util.smart_unicode(value) final_attrs = self.build_attrs(attrs, name=name) self.mce_settings['elements'] = "id_%s" % name @@ -83,7 +86,7 @@ # convert mce_settings from dict to JSON mce_json = simplejson.JSONEncoder().encode(self.mce_settings) - return mark_safe(self.TINY_MCE_HTML_FMT % - {'attrs': flatatt(final_attrs), - 'value': escape(value), + return safestring.mark_safe(self.TINY_MCE_HTML_FMT % + {'attrs': widgets.flatatt(final_attrs), + 'value': html.escape(value), 'settings_json': mce_json})