Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed dead code in modelforms.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 28d0a0f78840ff82d574c4827d75eda2ce6bf45a 1 parent 227c5e8
@carljm carljm authored
Showing with 1 addition and 22 deletions.
  1. +1 −22 django/forms/models.py
View
23 django/forms/models.py
@@ -21,8 +21,7 @@
__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_m2m():
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 #################################################################
Please sign in to comment.
Something went wrong with that request. Please try again.