def due_followups():
 def prep(r):
  resource = r.resource
  s3.crud_strings['dvr_case_activity']['title_list'] = T('Activities to follow up')
  if (not r.record):
   query = ((((FS('followup') == True) & (FS('followup_date') <= datetime.datetime.utcnow().date())) & (FS('completed') != True)) & ((FS('person_id$dvr_case.archived') == None) | (FS('person_id$dvr_case.archived') == False)))
   resource.add_filter(query)
  list_fields = ['case_id$reference', 'person_id$first_name', 'person_id$last_name', 'need_id', 'need_details', 'emergency', 'referral_details', 'followup_date', 'completed']
  resource.configure(list_fields=list_fields, insertable=False, deletable=False)
  return True
 s3.prep = prep
 return s3_rest_controller('dvr', 'case_activity')

def due_followups ( ) : def prep ( r ) : resource = r . resource s3 . crud_strings [ 'dvr_case_activity' ] [ 'title_list' ] = T ( 'Activities to follow up' ) if ( not r . record ) : query = ( ( ( ( FS ( 'followup' ) == True ) & ( FS ( 'followup_date' ) <= datetime . datetime . utcnow ( ) . date ( ) ) ) & ( FS ( 'completed' ) != True ) ) & ( ( FS ( 'person_id$dvr_case.archived' ) == None ) | ( FS ( 'person_id$dvr_case.archived' ) == False ) ) ) resource . add_filter ( query ) list_fields = [ 'case_id$reference' , 'person_id$first_name' , 'person_id$last_name' , 'need_id' , 'need_details' , 'emergency' , 'referral_details' , 'followup_date' , 'completed' ] resource . configure ( list_fields = list_fields , insertable = False , deletable = False ) return True s3 . prep = prep return s3_rest_controller ( 'dvr' , 'case_activity' )
restful controller for due follow-ups .