Ticket #8069: ticket8069-1.diff
File ticket8069-1.diff, 2.9 KB (added by , 16 years ago) |
---|
-
django/forms/models.py
399 399 400 400 # InlineFormSets ############################################################# 401 401 402 class BaseInlineForm set(BaseModelFormSet):402 class BaseInlineFormSet(BaseModelFormSet): 403 403 """A formset for child objects related to a parent.""" 404 404 def __init__(self, data=None, files=None, instance=None, 405 405 save_as_new=False, prefix=None): … … 408 408 self.save_as_new = save_as_new 409 409 # is there a better way to get the object descriptor? 410 410 self.rel_name = RelatedObject(self.fk.rel.to, self.model, self.fk).get_accessor_name() 411 super(BaseInlineForm set, self).__init__(data, files, prefix=prefix or self.rel_name)411 super(BaseInlineFormSet, self).__init__(data, files, prefix=prefix or self.rel_name) 412 412 413 413 def _construct_forms(self): 414 414 if self.save_as_new: 415 415 self._total_form_count = self._initial_form_count 416 416 self._initial_form_count = 0 417 super(BaseInlineForm set, self)._construct_forms()417 super(BaseInlineFormSet, self)._construct_forms() 418 418 419 419 def get_queryset(self): 420 420 """ … … 465 465 466 466 467 467 def inlineformset_factory(parent_model, model, form=ModelForm, 468 formset=BaseInlineForm set, fk_name=None,468 formset=BaseInlineFormSet, fk_name=None, 469 469 fields=None, exclude=None, 470 470 extra=3, can_order=False, can_delete=True, max_num=0, 471 471 formfield_callback=lambda f: f.formfield()): -
django/contrib/admin/options.py
1 1 from django import forms, template 2 2 from django.forms.formsets import all_valid 3 3 from django.forms.models import modelform_factory, inlineformset_factory 4 from django.forms.models import BaseInlineForm set4 from django.forms.models import BaseInlineFormSet 5 5 from django.contrib.contenttypes.models import ContentType 6 6 from django.contrib.admin import widgets 7 7 from django.contrib.admin.util import quote, unquote, get_deleted_objects … … 711 711 """ 712 712 model = None 713 713 fk_name = None 714 formset = BaseInlineForm set714 formset = BaseInlineFormSet 715 715 extra = 3 716 716 max_num = 0 717 717 template = None -
docs/admin.txt
548 548 ``formset`` 549 549 ~~~~~~~~~~~ 550 550 551 This defaults to ``BaseInlineForm set``. Using your own formset can give you551 This defaults to ``BaseInlineFormSet``. Using your own formset can give you 552 552 many possibilities of customization. Inlines are built around 553 553 `model formsets`_. 554 554