GithubHelp home page GithubHelp logo

Comments (5)

niphlod avatar niphlod commented on July 24, 2024

From [email protected] on December 04, 2011 14:08:27

I would be ok with 1 but at the dal level (no truncation when retrieving) but I do not want to milliseconds to appear in forms. It only confuses users. Perhaps the milliseconds could be stripper by the IS_DATETIME/IS_TIME validators?

from web2py.

niphlod avatar niphlod commented on July 24, 2024

From [email protected] on February 03, 2012 21:40:57

Attaching a diff against git trunk ( 8fbae09 ). Only lightly tested, but seems to do the job for me; please review and comment, as I test (and possibly fix problems), I'll fix it so that it can be integrated with trunk. I haven't tested it enough, so I don't claim it is ready for integration - but I would be happy for comments.

Notes: as is, requires Python>=2.6; I can incorporate e.g. http://stackoverflow.com/questions/698223/how-can-i-parse-a-time-string-containing-milliseconds-in-it-with-python for 2.5, or disable fractional second mode for 2.5

I can't test with informix / oracle which have special cases.

Added tests to the test_dal.py

Attachment: dal.patch test_dal.patch

from web2py.

niphlod avatar niphlod commented on July 24, 2024

From [email protected] on February 05, 2012 16:20:36

took a look at the dal.patch, overall it looks good by visual inspection. some comments from my perspective:

  • i would utilize this on GAE where i still have apps using python2.5 (yes i know i need to upgrade, but GAE still considers python2.7 support as beta). i guess you could argue that i need to upgrade, but i think since web2py still support 2.5 this should as well
  • in parse_time and parse_datetime you don't account for your WARNING setting, and you slightly change the parsing behavior i think.

otherwise looks OK to me.

from web2py.

niphlod avatar niphlod commented on July 24, 2024

From [email protected] on February 05, 2012 16:46:48

Thanks.

For python2.5, that also needs to include the subsecond time parser from stack overflow above (or something equivalent). mxDateTime has a good parser, but it's a shame to pull it in as a dependency just for this.

About warning setting in prase: thanks, I'll fix that. I'm not actually using warning or parse_* myself, so I missed that (I configure sqlite to return them as datetime objects)

you slightly change the parsing behavior i think.

Yes, but I think the change is only to reject wrong things that would have previously been accepted (silently and wrongly), such as: "1:2:3:4:". But when in truncate (compatibility) mode, it should remain completely the same as before, I think?

from web2py.

cassiobotaro avatar cassiobotaro commented on July 24, 2024

@niphlod @mdipierro The proposed fix is already closed, can we close this issue too? Related to https://github.com/web2py/web2py/pull/542/files

from web2py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.