11
11
class PolymorphicFormSetChild (object ):
12
12
"""
13
13
Metadata to define the inline of a polymorphic child.
14
- Provide this information in the :func:` polymorphic_inlineformset_factory` construction.
14
+ Provide this information in the :func:' polymorphic_inlineformset_factory' construction.
15
15
"""
16
16
17
17
def __init__ (self , model , form = ModelForm , fields = None , exclude = None ,
@@ -37,7 +37,7 @@ def __init__(self, model, form=ModelForm, fields=None, exclude=None,
37
37
def content_type (self ):
38
38
"""
39
39
Expose the ContentType that the child relates to.
40
- This can be used for the `` polymorphic_ctype`` field.
40
+ This can be used for the '' polymorphic_ctype'' field.
41
41
"""
42
42
return ContentType .objects .get_for_model (self .model )
43
43
@@ -48,8 +48,8 @@ def get_form(self, **kwargs):
48
48
# Do what modelformset_factory() / inlineformset_factory() does to the 'form' argument;
49
49
# Construct the form with the given ModelFormOptions values
50
50
51
- # Fields can be overwritten. To support the global ` polymorphic_child_forms_factory` kwargs,
52
- # that doesn't completely replace all ` exclude` settings defined per child type,
51
+ # Fields can be overwritten. To support the global ' polymorphic_child_forms_factory' kwargs,
52
+ # that doesn't completely replace all ' exclude' settings defined per child type,
53
53
# we allow to define things like 'extra_...' fields that are amended to the current child settings.
54
54
55
55
exclude = list (self .exclude )
@@ -78,7 +78,7 @@ def polymorphic_child_forms_factory(formset_children, **kwargs):
78
78
"""
79
79
Construct the forms for the formset children.
80
80
This is mostly used internally, and rarely needs to be used by external projects.
81
- When using the factory methods (:func:` polymorphic_inlineformset_factory` ),
81
+ When using the factory methods (:func:' polymorphic_inlineformset_factory' ),
82
82
this feature is called already for you.
83
83
"""
84
84
child_forms = OrderedDict ()
@@ -97,8 +97,8 @@ class BasePolymorphicModelFormSet(BaseModelFormSet):
97
97
as all variations need ot be exposed somewhere.
98
98
99
99
When switching existing formsets to the polymorphic formset,
100
- note that the ID field will no longer be named `` model_ptr`` ,
101
- but just appear as ``id`` .
100
+ note that the ID field will no longer be named '' model_ptr'' ,
101
+ but just appear as ''id'' .
102
102
"""
103
103
104
104
# Assigned by the factory
@@ -257,10 +257,10 @@ def polymorphic_modelformset_factory(model, formset_children,
257
257
"""
258
258
Construct the class for an polymorphic model formset.
259
259
260
- All arguments are identical to :func:` ~django.forms.models.modelformset_factory` ,
261
- with the exception of the `` formset_children`` argument.
260
+ All arguments are identical to :func:' ~django.forms.models.modelformset_factory' ,
261
+ with the exception of the '' formset_children'' argument.
262
262
263
- :param formset_children: A list of all child :class:` PolymorphicFormSetChild` objects
263
+ :param formset_children: A list of all child :class:' PolymorphicFormSetChild' objects
264
264
that tell the inline how to render the child model types.
265
265
:type formset_children: Iterable[PolymorphicFormSetChild]
266
266
:rtype: type
@@ -321,10 +321,10 @@ def polymorphic_inlineformset_factory(parent_model, model, formset_children,
321
321
"""
322
322
Construct the class for an inline polymorphic formset.
323
323
324
- All arguments are identical to :func:` ~django.forms.models.inlineformset_factory` ,
325
- with the exception of the `` formset_children`` argument.
324
+ All arguments are identical to :func:' ~django.forms.models.inlineformset_factory' ,
325
+ with the exception of the '' formset_children'' argument.
326
326
327
- :param formset_children: A list of all child :class:` PolymorphicFormSetChild` objects
327
+ :param formset_children: A list of all child :class:' PolymorphicFormSetChild' objects
328
328
that tell the inline how to render the child model types.
329
329
:type formset_children: Iterable[PolymorphicFormSetChild]
330
330
:rtype: type
0 commit comments