Posts

Showing posts with the label web2py

How do I apply a user defined function on a query in web2py DAL?

How do I apply a user defined function on a query in web2py DAL? I am new to web2py frame work, I am building an application where by I need to determine records from the database which are a given period(say months) ago basing on the dates I recorded them with (Assignment_date), for example, listing cases which are 1 month, 2 months or 3 months old. so here is how I had done it but its not working in the model I define my tables and I have these two functions one converts a parsed date (date from the database) and the other does date difference basing on current system time and returns an epoch difference of the two dates. stage =("Appeal","Investigation","Pre-Trial","Trial","Second Appeal") status =("Draft","Open") db.define_table('lfm_case', Field('title',requires=IS_NOT_EMPTY()), Field('Assignment_date','date',requires=IS_DATE(format=T('%Y-%m-%d'))),...