Saturday, October 6, 2012

lambda in openerp



# This will always give the server start time!
_defaults = {
    'timestamp': time.strftime('%Y-%m-%d %H:%M:%S'),
}

# You need to keep it callable, e.g:
_defaults = {
    'timestamp': lambda *x: time.strftime('%Y-%m-%d %H:%M:%S'),
}


1 comment:

  1. I am thankful to this blog for assisting me. I added some specified clues which are really important for me to use them in my writing skill. Really helpful stuff made by this blog.
    rack server

    ReplyDelete