Opened 17 years ago

Closed 17 years ago

#4018 closed (fixed)

Allow callable values as initial for newforms-fields

Reported by: David Danier <goliath.mailinglist@…> Owned by: Adrian Holovaty
Component: Forms Version: dev
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: no UI/UX: no

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

Download all attachments as: .zip

Change History (6)

by David Danier <goliath.mailinglist@…>, 17 years ago

comment:1 by Chris Beaven, 17 years ago

Triage Stage: UnreviewedReady 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 by Malcolm Tredinnick, 17 years ago

Needs tests: set
Triage Stage: Ready for checkinAccepted

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

by David Danier <goliath.mailinglist@…>, 17 years ago

Patch including tests

in reply to:  2 comment:3 by David Danier <goliath.mailinglist@…>, 17 years ago

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 by Russell Keith-Magee, 17 years ago

Resolution: fixed
Status: newclosed

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

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