From 28d0a0f78840ff82d574c4827d75eda2ce6bf45a Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Tue, 25 Jan 2011 04:08:17 +0000 Subject: [PATCH] Removed dead code in modelforms. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15305 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/forms/models.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/django/forms/models.py b/django/forms/models.py index 6babebbe36..034cb7acca 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -21,8 +21,7 @@ from formsets import BaseFormSet, formset_factory, DELETION_FIELD_NAME __all__ = ( 'ModelForm', 'BaseModelForm', 'model_to_dict', 'fields_for_model', - 'save_instance', 'form_for_fields', 'ModelChoiceField', - 'ModelMultipleChoiceField', + 'save_instance', 'ModelChoiceField', 'ModelMultipleChoiceField', ) def construct_instance(form, instance, fields=None, exclude=None): @@ -92,26 +91,6 @@ def save_instance(form, instance, fields=None, fail_message='saved', form.save_m2m = save_m2m return instance -def make_model_save(model, fields, fail_message): - """Returns the save() method for a Form.""" - def save(self, commit=True): - return save_instance(self, model(), fields, fail_message, commit) - return save - -def make_instance_save(instance, fields, fail_message): - """Returns the save() method for a Form.""" - def save(self, commit=True): - return save_instance(self, instance, fields, fail_message, commit) - return save - -def form_for_fields(field_list): - """ - Returns a Form class for the given list of Django database field instances. - """ - fields = SortedDict([(f.name, f.formfield()) - for f in field_list if f.editable]) - return type('FormForFields', (BaseForm,), {'base_fields': fields}) - # ModelForms #################################################################