Ticket #10208: fix_10208.diff
File fix_10208.diff, 1.6 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/options.py
318 318 fields = flatten_fieldsets(self.declared_fieldsets) 319 319 else: 320 320 fields = None 321 if self.exclude is None: 321 if self.exclude is not None: 322 exclude = list(self.exclude) 323 elif hasattr(self.form, '_meta') and self.form._meta.exclude is not None: 324 exclude = list(self.form._meta.exclude) 325 else: 322 326 exclude = [] 323 else: 324 exclude = list(self.exclude) 327 325 328 defaults = { 326 329 "form": self.form, 327 330 "fields": fields, -
tests/regressiontests/modeladmin/models.py
187 187 188 188 >>> band2.delete() 189 189 190 >>> class AdminConcertForm(forms.ModelForm): 191 ... class Meta: 192 ... model = Concert 193 ... exclude = ('transport', ) 194 ... 195 ... def __init__(self, *args, **kwargs): 196 ... super(AdminConcertForm, self).__init__(*args, **kwargs) 197 198 >>> class ConcertAdmin(ModelAdmin): 199 ... form = AdminConcertForm 200 201 >>> ma = ConcertAdmin(Concert, site) 202 >>> ma.get_form(request).base_fields.keys() 203 ['main_band', 'opening_band', 'day'] 204 190 205 # radio_fields behavior ################################################ 191 206 192 207 First, without any radio_fields specified, the widgets for ForeignKey