#10239 closed New feature (fixed)
Document modelform_factory
Reported by: | ingenieroariel | Owned by: | Tim Graham |
---|---|---|---|
Component: | Documentation | Version: | dev |
Severity: | Normal | Keywords: | dceu2011 |
Cc: | mbencun@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
modelform_factory is not documented in http://docs.djangoproject.com/en/dev/topics/forms/modelforms/
Attachments (2)
Change History (15)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Cc: | added |
---|
I didn't know it is considered internal, I use it very often. The formfield_callback to modify the form fields that are created for the corresponding db fields is in many cases much more useful/easier than defining the form field anew and pass all parameters explicitly (rather than having them being drawn from the model). The documentation also points out this shortcoming (Note box at http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#overriding-the-default-field-types-or-widgets.
Any chance of making this method public?
comment:3 by , 14 years ago
Severity: | → Normal |
---|---|
Summary: | Document modelform_factory → Document modelform_factory |
Triage Stage: | Accepted → Design decision needed |
Type: | → New feature |
I'm going to push this back to a design decision and mark it as a feature (the feature being the addition of this method to the documented public forms API).
Bring a discussion to the django-dev group.
comment:4 by , 14 years ago
Easy pickings: | unset |
---|---|
Owner: | changed from | to
Status: | new → assigned |
UI/UX: | unset |
comment:5 by , 14 years ago
Has patch: | set |
---|---|
Keywords: | dceu2011 added |
Owner: | changed from | to
Status: | assigned → new |
comment:6 by , 14 years ago
Thank you. This looks good. Would it make sense to include the function's signature in modelforms.txt?
comment:7 by , 13 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Design decision needed → Accepted |
While I can understand that this method may have been originally considered internal, I don't see any significant reason why it is more internal than modelformset_factory
, which is documented. Additionally, I've certainly seen it in use by the community in numerous places. Changing it substantially in a backwards-incompatible way without documentation would be detrimental at this stage.
As for this patch, there's a significant typo on line 540: "modelformset_factory" should be "modelform_factory".
However, what really bothers is that the only documentation for ModelForm
and modelformset_factory
right now is in the topic guide. There direly needs to be a API reference for these in addition to just adding another section to the topic guide.
If this patch expands to include a reference doc (new) as well as the existing improvements then I'd be willing to commit it.
by , 12 years ago
Attachment: | 10239.diff added |
---|
comment:9 by , 12 years ago
Patch needs improvement: | unset |
---|
Added an expanded patch with reference docs for modelform_factory and modelformset_factory.
comment:10 by , 12 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
The patch misses a newline after .. note::
on line 173. Other than that it looks good.
comment:11 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I think
modelform_factory
is considered internal -- it's used bymodelformset_factory
-- and thus shouldn't be documented along with the public code. Nevertheless, in an idea world everything ought to be documented somewhere!