I am trying to update *withhold_until_date* with the following 


import datetime
#product withholding in days
days = (0)

#get the days
pdays_row = db(db.product.withholding_period>0).select().first()
pdays =  pdays_row.pdays

#get the date
wdate_rows = db(db.stock_task.completed_date>0).select().first()
wdate = wdate_row.wdate

#finish date
fdate = wdate + datetime.timedelta(days + pdays)


def stock_tasks():
    db.stock_task.created_on.readable = True
    db.stock_task.created_by.readable = True
    db.stock_task.task_name.represent =lambda stock_task,row:\
        A(stock_task,_href=URL('view_stock_task',args=row.id))
    query = (db.stock_task.created_by==me)
    query = (db.stock_task.*withhold_until_date*==fdate)
    grid = SQLFORM.grid(query, orderby=~db.stock_task.created_on,
                        create=False,details=False,editable=False,
                        deletable=lambda row: (row.created_by==me),
                        fields =[
            db.stock_task.status,
            db.stock_task.task_name,
            db.stock_task.start_date,
            db.stock_task.completed_date,
            db.stock_task.mob,
            db.stock_task.*withhold_until_date*,
            db.stock_task.product,
            db.stock_task.paddock_name,
            db.stock_task.created_by,
            db.stock_task.created_on,
            ])
    return locals()

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to