Ticket #11277: 11277-admin-hiddeninput-helpers.diff
File 11277-admin-hiddeninput-helpers.diff, 830 bytes (added by , 14 years ago) |
---|
-
django/contrib/admin/helpers.py
87 87 class Fieldline(object): 88 88 def __init__(self, form, field, readonly_fields=None, model_admin=None): 89 89 self.form = form # A django.forms.Form instance 90 self.has_hidden_field = False 90 91 if not hasattr(field, "__iter__"): 91 92 self.fields = [field] 92 93 else: 93 94 self.fields = field 95 for field in self.fields: 96 if self.form[field].field.widget.is_hidden: 97 self.has_hidden_field = True 98 break 94 99 self.model_admin = model_admin 95 100 if readonly_fields is None: 96 101 readonly_fields = ()