Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1291 (closed defect: wontfix)

Opened 12 years ago

Last modified 10 years ago

DateTimeConverter and Pagination query strings do not validate

Reported by: abostick Owned by: anonymous
Priority: normal Milestone: 1.x
Component: TurboGears Version: 1.0.1
Severity: normal Keywords: needs tests
Cc:

Description

Using DateTimeConverter?() for validation with paginated result sets mostly works. The problem is pagination's query strings just return str() from the object ignoring format options for something like a datetime. datetime returns hours and minutes which the validator rejects if your format is %Y-%m-%d.

What I did is basically copy DateTimeConverter? to make my own DateConverter? that doesn't use datetime.datetime objects, but instead datetime.date objects. The changes between the two are trivial but this version of DateConverter? supports variable formats unlike the formencode version.

I would like to see this DateConverter? added to the turbogears validators so simple dates can be validated while used in a paginated data grid on output.

Attached is what works for me...

Attachments

dateconverter.txt Download (1.5 KB) - added by abostick 12 years ago.

Change History

Changed 12 years ago by abostick

comment:1 Changed 12 years ago by jorge.vargas

check out #1261

comment:2 Changed 12 years ago by alberto

  • Milestone changed from 1.1 to __unclassified__

Batch moved into unclassified from 1.1 to properly track progress on the later

comment:3 Changed 11 years ago by Chris Arndt

  • Keywords needs tests added
  • Owner set to anonymous
  • Component changed from unassigned to TurboGears

comment:4 Changed 10 years ago by jorge.vargas

  • Milestone changed from __unclassified__ to 1.x

comment:5 Changed 10 years ago by Chris Arndt

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

Cruft ticket. I don't really understand the problem this ticket is trying to address. Yes, the DateTimeConverter in turbogears.validators is limited, but it is easy to write your own validators. Closing ticket as wontfix.

Note: See TracTickets for help on using tickets.