Code

Opened 7 years ago

Closed 7 years ago

#4018 closed (fixed)

Allow callable values as initial for newforms-fields

Reported by: David Danier <goliath.mailinglist@…> Owned by: adrian
Component: Forms Version: master
Severity: Keywords: lazydate newforms initial callable
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Like in the model-fields this can be used to replace LazyDate, see http://groups.google.com/group/django-developers/msg/00bf8f4bf4bbc81c.

Attachments (2)

django-make-initial-newforms-value-callable.diff (987 bytes) - added by David Danier <goliath.mailinglist@…> 7 years ago.
django-make-initial-newforms-value-callable.2.diff (4.7 KB) - added by David Danier <goliath.mailinglist@…> 7 years ago.
Patch including tests

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by David Danier <goliath.mailinglist@…>

comment:1 Changed 7 years ago by SmileyChris

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

Thanks David. Probably only other suggestion is that it could do with a test or two, but it's a simple enough patch that I won't let that hold up the process.

comment:2 follow-up: Changed 7 years ago by mtredinnick

  • Needs tests set
  • Triage Stage changed from Ready for checkin to Accepted

Yep, needs tests before it can go. The easy patches are the easiest ones to write tests for. There is no excuse.

Changed 7 years ago by David Danier <goliath.mailinglist@…>

Patch including tests

comment:3 in reply to: ↑ 2 Changed 7 years ago by David Danier <goliath.mailinglist@…>

  • Needs tests unset

Replying to mtredinnick:

Yep, needs tests before it can go. The easy patches are the easiest ones to write tests for. There is no excuse.

So the new patch includes some tests ;-)

comment:4 Changed 7 years ago by russellm

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

(In [5209]) Fixed #4018 -- Added code to allow callables as initial data in newforms. Thanks for the patch, David Danier.

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.