Django

Code

Ticket #4018 (closed: fixed)

Opened 1 year ago

Last modified 1 year ago

Allow callable values as initial for newforms-fields

Reported by: David Danier <goliath.mailinglist@gmx.de> Assigned to: adrian
Milestone: Component: Forms
Version: SVN Keywords: lazydate newforms initial callable
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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

Attachments

django-make-initial-newforms-value-callable.diff (1.0 kB) - added by David Danier <goliath.mailinglist@gmx.de> on 04/12/07 03:40:40.
django-make-initial-newforms-value-callable.2.diff (4.7 kB) - added by David Danier <goliath.mailinglist@gmx.de> on 04/23/07 03:18:58.
Patch including tests

Change History

04/12/07 03:40:40 changed by David Danier <goliath.mailinglist@gmx.de>

  • attachment django-make-initial-newforms-value-callable.diff added.

04/22/07 16:25:19 changed by SmileyChris

  • needs_better_patch changed.
  • stage changed from Unreviewed to Ready for checkin.
  • needs_tests changed.
  • needs_docs changed.

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.

(follow-up: ↓ 3 ) 04/23/07 00:22:39 changed by mtredinnick

  • needs_tests set to 1.
  • 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.

04/23/07 03:18:58 changed by David Danier <goliath.mailinglist@gmx.de>

  • attachment django-make-initial-newforms-value-callable.2.diff added.

Patch including tests

(in reply to: ↑ 2 ) 04/23/07 03:21:59 changed by David Danier <goliath.mailinglist@gmx.de>

  • needs_tests deleted.

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 ;-)

05/12/07 10:50:32 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #4018 (Allow callable values as initial for newforms-fields)




Change Properties
Action