Oleg! Thanks for reply. Yeah, but is ok since finally I don't care how is stored in the DB since I can parse it later (sometimes I ask questions in lists, forums and in a few minutes I reply myself with a solution... sorry :P)
About signature: lol (If true I didn't know :P) Thanks! -- Gustavo A. Díaz GDNet - www.gdnet.com.ar "Servicios TI para tus necesidades" 2015-08-26 14:26 GMT-03:00 Oleg Broytman <p...@phdru.name>: > Hi! > > On Wed, Aug 26, 2015 at 02:07:38PM -0300, "Gustavo A. D??az" < > gustavo.d...@gmail.com> wrote: > > Is there anyway to change for date format on DateCol default value? > > > > I use DateCol(default=datetime.strftime(datetime.now(), '%d-%m-%Y') but > > does not work: > > > > unhandled formencode.api.Invalid "expected a date/time string of the > > '%Y-%m-%d' format in the DateTimeCol 'modified', got <class 'str'> > > '26-08-2015' instead" > > The problem is that the code that's used to parse user input is also > used to parse output from the backend, so if you want to change the > format yo have to change it at the DB level too. And then you have to > change DateTimeConverter to pass date/time strings to the backing in the > proper format. > See the discussion and some examples at > https://github.com/sqlobject/sqlobject/issues/114 > > Your best bet, I think, is to parse d/t strings yourself and pass > date/datetime instances to your column(s). > > > Thanks! > > > > -- > ^ You have forgotten a space here; signatures are separated by two > dashes and a space. (-: > > > Gustavo A. D??az > > GDNet - www.gdnet.com.ar > > "Servicios TI para tus necesidades" > > Oleg. > -- > Oleg Broytman http://phdru.name/ p...@phdru.name > Programmers don't die, they just GOSUB without RETURN. > > > ------------------------------------------------------------------------------ > _______________________________________________ > sqlobject-discuss mailing list > sqlobject-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss >
------------------------------------------------------------------------------
_______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss