def patch():
from django.forms import forms, formsets, util, widgets
# Add __html__ methods to these classes:
classes = [
forms.BaseForm,
forms.BoundField,
formsets.BaseFormSet,
util.ErrorDict,
util.ErrorList,
widgets.Media,
widgets.RadioFieldRenderer,
]
try:
classes.append(widgets.RadioChoiceInput)
except AttributeError:
classes.append(widgets.RadioInput)
for cls in classes:
if not hasattr(cls, '__html__'):
cls.__html__ = __html__
评论列表
文章目录