#20000: Allow overriding `label`, `help_text` and `error_messages` for the
default
fields in `ModelForm`
-----------------------------+------------------------------------
Reporter: loic84 | Owner: loic84
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by timo):
An alternative which may mitigate the underlying issue of making simple
customizations on a `ModelForm` without having to redeclare the options
that are generated by the default form:
{{{
FooFormField = MyModel._meta.get_field('foo').formfield() # would probably
need a better API
class MyModelForm(ModelForm):
foo = FooFormField(label='My Foo')
}}}
Alternatively, we could recommend doing customization's in `__init__`, but
it doesn't see like the cleanest solution.
--
Ticket URL: <https://code.djangoproject.com/ticket/20000#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.f58ad5d604ac4952e4c687c41d8ad766%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.