Opened 6 years ago

Closed 6 years ago

#11187 closed (wontfix)

Documentation: Explicit is better than implicit.

Reported by: arbitraryuser Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The short version:
I think it might make sense to modify the documentation at to say >>> f = ArticleForm(data=request.POST) rather than just >>> f = ArticleForm(request.POST) as users will run into 'non-keyword arg after keyword arg' issues when using more advanced incantations of ModelForm.

The long version:
I ran into a problem with because I was passing my form def an additional varible with which to limit the options of drop down box. This works fine until you are also doing a ModelForm based update and need to pass data, your instance *and* an object that you want to filter with. I had to in the source to see what the arg's name actually was.

PS. Loving Django so f-ing much right now... :)

Change History (1)

comment:1 Changed 6 years ago by Alex

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Passing it as a positional argument is a completely valid way to instantiate a form, this is not a case of explicit vs. implicit.

Note: See TracTickets for help on using tickets.
Back to Top