Opened 17 years ago

Closed 16 years ago

#3113 closed enhancement (wontfix)

[patch] newforms support for parsedatetime with DateField

Reported by: Brantley <deadwisdom@…> Owned by: nobody
Component: Forms Version:
Severity: normal Keywords:
Cc: sam@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

What about these for "cleaning" Date-based fields? Or maybe for a "HumanDateTimeField()"? They would allow people to enter in hazy, non specific dates and times, like "tomorrow", "next tuesday", or "10/24/2006".

http://cheeseshop.python.org/pypi/ParseTime/1.0
http://cheeseshop.python.org/pypi/parsedatetime/0.8.0

The second seems more robust, but the first seems more lightweight.

Attachments (1)

extras.py (1.7 KB ) - added by Brantley <deadwisdom@…> 17 years ago.
HumanDateTimeField

Download all attachments as: .zip

Change History (14)

comment:1 by James Bennett, 17 years ago

AFAIK this is possible right now because we bundle Simon's magic date-parsing JavaScript. Is that not working for you?

comment:2 by Brantley, 17 years ago

Oh, I hadn't realized. Of course that would be good. I'm not sure that it should be done at the Javascript level, though.

comment:3 by Adrian Holovaty, 17 years ago

Resolution: wontfix
Status: newclosed

As those two date-parsing libraries are third-party modules (and released under different licenses than ours), I don't think we should use them by the default DateField. If you reopen this with a full patch, we could add it to django.newforms.extras as an optional add-on for folks who have it installed. (If you decide to do that, I'd encourage you to use parsedatetime rather than ParseTime, because the former appears to be more portable across different OSes.)

comment:4 by Brantley <deadwisdom@…>, 17 years ago

Will do.

comment:5 by Brantley <deadwisdom@…>, 17 years ago

Well, since this is no django.newforms.extras yet, there is no diff available. So I attached extras.py.

by Brantley <deadwisdom@…>, 17 years ago

Attachment: extras.py added

HumanDateTimeField

comment:6 by Brantley <deadwisdom@…>, 17 years ago

Resolution: wontfix
Status: closedreopened

comment:7 by Adrian Holovaty, 17 years ago

Summary: What about "humanizing" the date entry field?[patch] newforms support for parsedatetime with DateField

comment:8 by Adrian Holovaty, 17 years ago

#8 is similar. We can close that ticket once we've integrated newforms into the Django admin site and with Django models.

comment:9 by Adrian Holovaty, 17 years ago

Triage Stage: UnreviewedDesign decision needed

comment:10 by Gary Wilson <gary.wilson@…>, 17 years ago

From this comment in #8:

What about using dateutil's parse method? Seems to work really well:

>>> from dateutil.parser import parse
>>> parse("Tuesday")
datetime.datetime(2006, 12, 26, 0, 0)

for example...

See: http://labix.org/python-dateutil#head-c0e81a473b647dfa787dc11e8c69557ec2c3ecd2

comment:11 by Gary Wilson <gary.wilson@…>, 17 years ago

Needs documentation: set

Assuming that the 3rd party library will have it's own testing.

comment:12 by anonymous, 16 years ago

Cc: sam@… added

comment:13 by Jacob, 16 years ago

Resolution: wontfix
Status: reopenedclosed

Since it's now pretty easy to write custom fields (http://www.djangoproject.com/documentation/custom_model_fields/), this is now something anyone can just do in their own apps.

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