Code

Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#11674 closed Cleanup/optimization (fixed)

documentation clarifications on ModelForms & ModelFormsets Meta fields

Reported by: david.h.haas@… Owned by: raulcd
Component: Documentation Version: master
Severity: Normal Keywords: ModelForm, Meta class, easy-pickings
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

Based on discussion from this thread:

http://groups.google.com/group/django-users/browse_thread/thread/19a8b01d87819119/217ac9ecee6f474f

the documentation of the fields attribute of a ModelForms inner Meta class should be clarified/expanded. Basically, add a sentence that states if you define fields (or excludes) on an inner Meta class, any excluded field 1) will not appear on the form by default, 2) will not be initialized from a model instance if manually added back to the form, and 3) will not be set by the form's save method. A similar caveat should be added to the ModelFormset documentation.

In the current documentation:

http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-a-subset-of-fields-on-the-form

Points 1 & 3 are mentioned, but 2 is not.

Attachments (1)

11674.diff (2.1 KB) - added by PieterSwinkels 3 years ago.
changes to the documentation

Download all attachments as: .zip

Change History (14)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by julien

  • Keywords class, easy-pickings added; class removed
  • Severity set to Normal
  • Type set to Cleanup/optimization

comment:3 Changed 3 years ago by raulcd

  • Owner changed from nobody to raulcd
  • Status changed from new to assigned

comment:4 Changed 3 years ago by jacob

  • Easy pickings set

comment:5 Changed 3 years ago by PieterSwinkels

  • UI/UX unset

DjangoCon Europe 2011 sprint: commenced work on this ticket

Changed 3 years ago by PieterSwinkels

changes to the documentation

comment:6 Changed 3 years ago by PieterSwinkels

  • Has patch set

I have attached a diff with the (I hope) requested changes.

comment:7 Changed 3 years ago by frog32

the changes are undersandable but not de cleanest english. but if no one refactors the text it should be included like that. I also tested the patch if it breaks docs compilation and it doesn't.

comment:8 Changed 3 years ago by evanlec@…

  • Triage Stage changed from Accepted to Ready for checkin

I think the attached diff has quite clean English. I looked over it myself (I'm a native English speaker, College graduate) and I couldn't think of a way to put it any better. I say this patch is ready to go!

comment:8 Changed 3 years ago by evanlec@…

  • Triage Stage changed from Accepted to Ready for checkin

I think the attached diff has quite clean English. I looked over it myself (I'm a native English speaker, College graduate) and I couldn't think of a way to put it any better. I say this patch is ready to go!

comment:8 Changed 3 years ago by evanlec@…

I think the attached diff has quite clean English. I looked over it myself (I'm a native English speaker, College graduate) and I couldn't think of a way to put it any better. I say this patch is ready to go!

comment:9 Changed 3 years ago by anonymous

Oh gosh, sorry for the spam :( The comment form didn't appear to be submitting properly

comment:10 Changed 3 years ago by PaulM

  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed this in r16875. Thanks for the patch!

comment:11 Changed 3 years ago by PaulM

In [16881]:

[1.3.X] Fixed #11674 -- Clarified docs on excluded fields of ModelForms. Thanks PieterSwinkels for the patch.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.