Il 16/04/2012 10:25, Annet ha scritto:
In db.py I defined a table:

db.define_table('Node',
    Field('createdOn',type='datetime',writable=False,readable=False),
    migrate=False)

db.Node.createdOn.default=request.now
db.Node.createdOn.requires=IS_DATETIME(str(T('%Y-%m-%d 
%H:%M:%S')))

Now, when I add this validator:


db.Node.createdOn.represent = lambda v: v.strftime('%d/%m/%Y')

the error could not be in this line... for example if you forgot to close brackets opened in the lines before, so maybe it's better you report much more code :)

    M.


... and save the file I get a failed to compile file error because of invalid syntax in this line.
What is the correct syntax?

Kind regards,

Annet.

Reply via email to