Ticket #6115: modelform_for_model.diff
File modelform_for_model.diff, 642 bytes (added by , 17 years ago) |
---|
-
django/newforms/models.py
288 288 class ModelForm(BaseModelForm): 289 289 __metaclass__ = ModelFormMetaclass 290 290 291 def modelform_for_model(model, form=ModelForm, **kwargs): 292 kwargs['model'] = model 293 opts = model._meta 294 options = type('%sModelFormMeta' % opts.object_name, (object,) , kwargs) 295 return type('%sModelForm' % opts.object_name, (form,) , {'Meta': options}) 291 296 292 297 # Fields ##################################################################### 293 298