The script:

================================================================

SQLOBJECT_URI = "%s://%s:[EMAIL PROTECTED]/%s?autoCommit=%i" % ( SCHEME,
                                                      USERNAME,
                                                      PASSWORD,
                                                      SERVER,
                                                      DATABASE,
                                                      AUTOCOMMIT )

today = datetime.datetime.now()
                                                      
# Connect to Sybase
conn = sqlobject.connectionForURI( SQLOBJECT_URI )
sqlobject.sqlhub.processConnection = conn

class Test( sqlobject.SQLObject ):
    name = sqlobject.StringCol( length=64 )
    startTime = sqlobject.DateTimeCol( )

Test.createTable( ifNotExists = True )

print repr( today )
    
fod = Test( name="test object", startTime=today )
    
# END

The Output:

============================================

C:\dev\fid\iron\cpg\dev\src\bin>python ./sqlobjectTest.py
datetime.datetime(2006, 5, 23, 18, 39, 48, 84000)
Traceback (most recent call last):
  File "./sqlobjectTest.py", line 38, in ?
    fod = Test( name="test object", startTime=today )
  File "C:\dev\fid\iron\cpg\dev\src\bin\sqlobject\declarative.py", line
93, in _
wrapper
    return fn(self, *args, **kwargs)
  File "C:\dev\fid\iron\cpg\dev\src\bin\sqlobject\main.py", line 1195,
in __init
__
    self._create(id, **kw)
  File "C:\dev\fid\iron\cpg\dev\src\bin\sqlobject\main.py", line 1222,
in _creat
e
    self._SO_finishCreate(id)
  File "C:\dev\fid\iron\cpg\dev\src\bin\sqlobject\main.py", line 1249,
in _SO_fi
nishCreate
    self._init(id)
  File "C:\dev\fid\iron\cpg\dev\src\bin\sqlobject\main.py", line 956, in
_init
    self._SO_selectInit(selectResults)
  File "C:\dev\fid\iron\cpg\dev\src\bin\sqlobject\main.py", line 1147,
in _SO_se
lectInit
    colValue = col.to_python(colValue, self._SO_validatorState)
  File "C:\dev\fid\iron\cpg\dev\src\bin\sqlobject\col.py", line 947, in
to_pytho
n
    (self.format, self.name, type(value), value), value, state)
formencode.api.Invalid: expected an date/time string of the '%Y-%m-%d
%H:%M:%S'
format in the DateTimeCol 'startTime', got <type 'DateTimeType'> 'May 23
2006  6
:39PM' instead


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Oleg Broytmann
> Sent: 23 May 2006 18:01
> To: [email protected]
> Subject: Re: [SQLObject] SQLObject 0.7.1b1
> 
> On Tue, May 23, 2006 at 05:08:43PM +0100, Fadhley, Salim (FID) wrote:
> > I'm still getting that date validator bug.
> 
>    Can you write a short script that demonstrates the bug?
> 
> Oleg.
> -- 
>      Oleg Broytmann            http://phd.pp.ru/            
> [EMAIL PROTECTED]
>            Programmers don't die, they just GOSUB without RETURN.
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web 
> services, security?
> Get stuff done quickly with pre-integrated technology to make 
> your job easier Download IBM WebSphere Application Server 
> v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&;
> dat=121642
> _______________________________________________
> sqlobject-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss
>
--------------------------------------------------------

This is not an offer (or solicitation of an offer) to buy/sell the 
securities/instruments mentioned or an official confirmation.  Morgan Stanley 
may deal as principal in or own or act as market maker for 
securities/instruments mentioned or may advise the issuers.  This is not 
research and is not from MS Research but it may refer to a research 
analyst/research report.  Unless indicated, these views are the author's and 
may differ from those of Morgan Stanley research or others in the Firm.  We do 
not represent this is accurate or complete and we may not update this.  Past 
performance is not indicative of future returns.  For additional information, 
research reports and important disclosures, contact me or see 
https://secure.ms.com/servlet/cls.  You should not use e-mail to request, 
authorize or effect the purchase or sale of any security or instrument, to send 
transfer instructions, or to effect any other transactions.  We cannot 
guarantee that any such requests received via e-mail will be processed in a 
timely manner.  This communication is solely for the addressee(s) and may 
contain confidential information.  We do not waive confidentiality by 
mistransmission.  Contact me if you do not wish to receive these 
communications.  In the UK, this communication is directed in the UK to those 
persons who are market counterparties or intermediate customers (as defined in 
the UK Financial Services Authority's rules).


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to