Django

Code

Ticket #5714 (new)

Opened 2 years ago

Last modified 2 years ago

Date/Time fields' clean methods need strip()

Reported by: Simon Litchfield <simon@quo.com.au> Assigned to: nobody
Milestone: Component: Forms
Version: SVN Keywords:
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

Minor, but trailing/leading spaces throw date/time fields.

Believe it or not this has come up on two separate occasions now, so I thought I'd submit the patch.

Attachments

newforms-datetime-strip.diff (1.2 kB) - added by Simon Litchfield on 10/09/07 07:50:32.

Change History

10/09/07 07:50:32 changed by Simon Litchfield

  • attachment newforms-datetime-strip.diff added.

01/03/08 03:32:44 changed by SmileyChris

  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs changed.

I'll push to a design decision, in the past these issues have been brushed off with a "create your own subclass" but I like the idea.

In fact, I'd be tempted to put a clean_strip attribute on Field (defaulting to False for most, overridden to True default for date/time fields) since this is a common request. But that's just me dreaming :)


Add/Change #5714 (Date/Time fields' clean methods need strip())




Change Properties
Action