h
Size: a a a
h
PZ
<slug:category_slug>
PZ
h
h
h
PZ
a
NP
NP
NP
def create_custom_form(custom_exclude):
class AuthorForm(ModelForm):
class Meta:
model = Author
fields = ['name', 'title', 'birth_date']
if custom_exclude:
exclude = custom_exclude
return AuthorForm
...
CustomAuthorForm = create_custom_form(['field_to_exclude'])
form = CustomAuthorForm()
NP
__init__
, если не нужна такая жесть и декларативностьDT
S
DT
S
DT
S
АВ