mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Refs #23919 -- Removed str() conversion of type and method __name__.
This commit is contained in:
@@ -441,7 +441,7 @@ def formset_factory(form, formset=BaseFormSet, extra=1, can_order=False,
|
||||
'min_num': min_num, 'max_num': max_num,
|
||||
'absolute_max': absolute_max, 'validate_min': validate_min,
|
||||
'validate_max': validate_max}
|
||||
return type(form.__name__ + str('FormSet'), (formset,), attrs)
|
||||
return type(form.__name__ + 'FormSet', (formset,), attrs)
|
||||
|
||||
|
||||
def all_valid(formsets):
|
||||
|
||||
@@ -518,11 +518,11 @@ def modelform_factory(model, form=ModelForm, fields=None, exclude=None,
|
||||
# If parent form class already has an inner Meta, the Meta we're
|
||||
# creating needs to inherit from the parent's inner meta.
|
||||
bases = (form.Meta,) if hasattr(form, 'Meta') else ()
|
||||
Meta = type(str('Meta'), bases, attrs)
|
||||
Meta = type('Meta', bases, attrs)
|
||||
if formfield_callback:
|
||||
Meta.formfield_callback = staticmethod(formfield_callback)
|
||||
# Give this new form class a reasonable name.
|
||||
class_name = model.__name__ + str('Form')
|
||||
class_name = model.__name__ + 'Form'
|
||||
|
||||
# Class attributes for the new form class.
|
||||
form_class_attrs = {
|
||||
|
||||
Reference in New Issue
Block a user